-4

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

Padma
  • 1
  • 4
    What have you tried ? – Tanay Sharma Feb 04 '19 at 16:56
  • 1
    Welcome to StackOverflow. This question is considered a poor question because you did not post the source code you are using to try and solve the problem. Please edit your question and add the code in question. More details on how to write a good question can be found here: https://stackoverflow.com/help/how-to-ask . – Stephen M -on strike- Feb 04 '19 at 17:17

1 Answers1

-1

You, probably should use method .getText() on your "School" object

Naya
  • 850
  • 6
  • 19