Introduction To XML Trees

  1. XML document has a single root node.
  2. The tree is a general ordered tree.
  3. A parent node may have any number of children.
  4. Child nodes are ordered and may have siblings.
  5. Preorder traversals are usually used to get the information, out of the tree.

Trees

Simple XML Document

  1. <?xml version = “1.0” ?> <address>  
  2. <name>  
  3. <first>Alice</first></br>  
  4. <last>Lee</last></br>  
  5. </name>  
  6. <email>[email protected]</email></br>  
  7. <phone>123-45-6789</phone></br>  
  8. <birthday>  
  9. <year>1983</year></br>  
  10. <month>07</month></br>  
  11. <day>15</day>  
  12. </birthday>  
  13. </address>  
Program Demo

Write the code from XMLCopyEditor.

Save Any Location(EX:Sample.xml). 

code

Output

Output

 

Ebook Download
View all
Learn
View all