/    /  XML – Parent

XML – Parent

In the XML family tree , parent can be identified as the outer element of any other inner elements in the hierarchy.

For suppose, if we have 2 elements called element A , element B and if the element A is the outer element of element B, then element A will be called as Parent of element B.

Please find the below example and identify the parent element of “city”.

<?xml version="1.0" encoding="UTF-8"?> 

		<name> Hari</name> 
		<city> hyderabad</city> 
		<name> sneha</name> 
		<city> banglore</city> 

		<name> Sanjay</name> 
		<location> Mumbai</location> 
		<name> Micheal</name> 
		<location> Washington</location> 

Below figure shows the parent element of “city”. 

XML parent-i2tutorials.com