E
ETL
Hi,
I have an xml document that feeds a treeview menu on my web site. The
structure of the xml file is as follows.
<XML type="text/xml">
<root>
<a0 name="One">
<a0_0 html="Report 1" id="1" />
<a0_1 html="Report 2" id="2" />
<a0_2 html="Report 3" id="3" />
</a0>
<a1 name="Two">
<a1_0 html="Report 1" id="4" />
<a1_1 html="Report 2" id="5" />
<a1_2 html="Report 3" id="6" />
</a1>
<a2 name="Three">
<a2_1 name="Three_One">
<a2_1_1 html="Report 1" id="7" />
<a2_2_2 html="Report 2" id="8" />
</a2_1>
<a2_2 name="Three_Two">
<a2_2_1 html="Email Report 1" id="9" />
<a2_2_2 html="Email Report 2" id="10" />
<a2_2_3 html="Email Report 3" id="11" />
</a2_2>
</a2>
</root>
</XML>
I want to buld an asp.net application that takes in a node id attribute
and returns the html attribute of the desired node. So if 11 were
passed in it would return "Email Report 3".
I've found lots of xPath examples that search a straigh aligned xml
file that doesn't have nested attributes but my file is more complex
and includes tierded menu folders.
How can I search the entire document for the ID attribute.
One other thing, is there a difference in xPath quesries when using
attribute or element based xml? Just curious.
Thanks for your help.
Regards
Eric
I have an xml document that feeds a treeview menu on my web site. The
structure of the xml file is as follows.
<XML type="text/xml">
<root>
<a0 name="One">
<a0_0 html="Report 1" id="1" />
<a0_1 html="Report 2" id="2" />
<a0_2 html="Report 3" id="3" />
</a0>
<a1 name="Two">
<a1_0 html="Report 1" id="4" />
<a1_1 html="Report 2" id="5" />
<a1_2 html="Report 3" id="6" />
</a1>
<a2 name="Three">
<a2_1 name="Three_One">
<a2_1_1 html="Report 1" id="7" />
<a2_2_2 html="Report 2" id="8" />
</a2_1>
<a2_2 name="Three_Two">
<a2_2_1 html="Email Report 1" id="9" />
<a2_2_2 html="Email Report 2" id="10" />
<a2_2_3 html="Email Report 3" id="11" />
</a2_2>
</a2>
</root>
</XML>
I want to buld an asp.net application that takes in a node id attribute
and returns the html attribute of the desired node. So if 11 were
passed in it would return "Email Report 3".
I've found lots of xPath examples that search a straigh aligned xml
file that doesn't have nested attributes but my file is more complex
and includes tierded menu folders.
How can I search the entire document for the ID attribute.
One other thing, is there a difference in xPath quesries when using
attribute or element based xml? Just curious.
Thanks for your help.
Regards
Eric