3 ms·
The structure of XML (which element contains which) was meant to be used to link these elements to the underlying text they're marking up. When there's no text
by Mikhail_Edoshin 7y ago
The structure of XML (which element contains which) was meant to be used to link these elements to the underlying text they're marking up. When there's no text and just metadata (elements), there's no natural structure for them. It can still exist, of course, but what it means is totally up to the designer of this XML format. It's piggybacking the structural relation for something else. In this example it's piggybacked for "boss-employee" relation, but it could totally be flat like that:
<Employees>
<Employee id="1" name="Michael Scott" title="Regional Manager" />
<Employee id="2" boss-id="1" name="Dwight Schrute" title="Ass. Regional Mgr" />
<Employee id="3" boss-id="1" name="Jim Halpert" title="Head of Sales">
<Employee id="4" boss-id="3" name="Andy Bernard" title="Sales Rep" />
<Employee id="5" boss-id="3" name="Phyllis Lapin" title="Sales Rep" />
<Employee id="6" boss-id="1" name="Pam Beesly" title="Office Administrator" />
</Employees>