简体   繁体   中英

Unable to read complex XML deep nested structure using Java

Below is my sample xml, and I am unable to read the value - Johnson Elementary School from xml using my Java code. I am able to read attributes, but not the value passed inside School ie. Johnson Elementary School. Let me know.

Blockquote

<School>
   <Student>
     <name>John</name>
     <age>15</age>            
   </Student>
 Johnson Elementary School 
</School>

Blockquote

Thanks Padma

你,可能应该在你的“学校”对象上使用方法 .getText()

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM