In this tutorial you will learn about the XML Nesting and its application with practical example.
When an XML Element is defined inside another elements it is said to be nested inside another element and this process is known as “XML Element Nesting”. All the nested elements are child of the container tag (Parent Tag).
Table Of Contents−
Example:
1 2 3 4 5 6 7 8 |
<inbox> <message id="1"> <from>John</from> <subject>Test Message 1</subject> <body>Hello John!</body> </message> </inbox> |
In the above example “from”,”subject” and “body” tags are nested inside the “message” tag which is itself nested inside root element “inbox”.
It is necessary to have all XML elements must be properly nested within each other and child element should be closed before parent element in specified order.