XML Elements



Consider Following Document –

<student>
  <male std="1st">
    <name>Pritesh</name>
    <age>6</age>
    <marks>90.45</marks>
  </male>
  <female std="1st">
    <name>Pooja</name>
    <age>5</age>
    <marks>96.67</marks>
  </female>
</student>

XML Element Consists Of –

  • Other Element
  • Text
  • Attributes
  • Mixing Above Elements

Explanation :

  1. XML Element Contain Other XML Elements.
  2. Above XML Contain <student> tag which contain other Elements.
  3. <male> element have attribute std 
  4. Similarly <female> element have attribute std .
  5. <male> and <female> each element have 3 sub elements – <name><age> and <marks>

What is an XML ELement