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 :
- XML Element Contain Other XML Elements.
- Above XML Contain <student> tag which contain other Elements.
- <male> element have attribute std
- Similarly <female> element have attribute std .
- <male> and <female> each element have 3 sub elements - <name>, <age> and <marks>