I have a DataSet I want to work with as Xml using XmlDataDocument. I can't
figure out how to query the resultant Xml using XPath. From the following XML
below, what XPath query will return the list of orders for each Male customer?
Because some tables in my DataSet have >1 foreign key columns, it is not
possible to set up a nested DataRelation for all relationships - a DataTable
can only be the child of at most one nested DataRelation. As a result, the
XmlDataDocument is tricky to navigate because I have to perform "joins" and I
don't know that XPath can do them. If there is no way to do this with XPath,
what would the XSL look like to transform the Xml below so Order appears as a
child element of Customer, in which case the XPath becomes straightforward.
In general, I want to be able to traverse my DataSet using XPath and be able
to follow every DataRelation, regardless of whether it is nested.
<root xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<customer>
<customerName>Justin</customerName>
<gender>Male</gender>
</customer>
<customer>
<customerName>Bob</customerName>
<gender>Male</gender>
</customer>
<customer>
<customerName>Mary</customerName>
<gender>Female</gender>
</customer>
<customer>
<customerName>Erin</customerName>
<gender>Female</gender>
</customer>
<order>
<customerName>Justin</customerName>
<orderNumber>32</orderNumber>
</order>
<order>
<customerName>Justin</customerName>
<orderNumber>74</orderNumber>
</order>
<order>
<customerName>Mary</customerName>
<orderNumber>132</orderNumber>
</order>
<order>
<customerName>Bob</customerName>
<orderNumber>98</orderNumber>
</order>
<order>
<customerName>Erin</customerName>
<orderNumber>204</orderNumber>
</order>
</root>