for an xml document like below:
<?xml version = "1.0" encoding="Windo ws-1252" standalone="yes "?>
<data>
<tab>
<category name="Software" > Test purpose
<subcategory name="Software3 ">
<method url="addSoftwar e.aspx">Add</method>
<method url="editSoftwa re.aspx">Edit</method>
<method url="searchSoft ware.aspx">Sear ch</method>
</subcategory>
</category>
</tab>
<tab>
<category name="Software" > Test purpose
<subcategory name="Software5 ">
<method url="addSoftwar e.aspx">Add</method>
<method url="editSoftwa re.aspx">Edit</method>
<method url="searchSoft ware.aspx">Sear ch</method>
</subcategory>
</category>
</tab>
<tab>
<category name="Software2 " > Test purpose
<subcategory name="Software2 ">
<method url="addSoftwar e2.aspx">Add</method>
<method url="editSoftwa re2.aspx">Edit</method>
<method url="searchSoft ware2.aspx">Sea rch</method>
</subcategory>
</category>
</tab>
</data>
to select node which category is "Software" and subcategory is "Software3"
/data/tab/category[@name="Software "]/subcategory[@name="Software 3"]
"jerry.xudd d" <je********@dis cussions.micros oft.com> wrote in message
news:91******** *************** ***********@mic rosoft.com...
Hi,
I have a xml file like this
<tab>
<category name="Software" > Test purpose
<subcategory name="Software" >
<method url="addSoftwar e.aspx">Add</method>
<method url="editSoftwa re.aspx">Edit</method>
<method url="searchSoft ware.aspx">Sear ch</method>
</subcategory>
</category>
</tab>
Yesterday I asked a question about getting a node which has a specific
child
node. However I realised that I need to get a node with a specific name
and
has a specific child node as well. (e.g. a node's name is software and the
child node's name is software too)
I tried:
/tab/category[@name='software ' and subcategory[@name='Software ']]
But it did not give me any thing.
Would someone tell me the right way to do it?
Many Thanks
--
hello, please help