for an xml document like below:
<?xml version = "1.0" encoding="Windows-1252" standalone="yes"?>
<data>
<tab>
<category name="Software" > Test purpose
<subcategory name="Software3">
<method url="addSoftware.aspx">Add</method>
<method url="editSoftware.aspx">Edit</method>
<method url="searchSoftware.aspx">Search</method>
</subcategory>
</category>
</tab>
<tab>
<category name="Software" > Test purpose
<subcategory name="Software5">
<method url="addSoftware.aspx">Add</method>
<method url="editSoftware.aspx">Edit</method>
<method url="searchSoftware.aspx">Search</method>
</subcategory>
</category>
</tab>
<tab>
<category name="Software2" > Test purpose
<subcategory name="Software2">
<method url="addSoftware2.aspx">Add</method>
<method url="editSoftware2.aspx">Edit</method>
<method url="searchSoftware2.aspx">Search</method>
</subcategory>
</category>
</tab>
</data>
to select node which category is "Software" and subcategory is "Software3"
/data/tab/category[@name="Software"]/subcategory[@name="Software3"]
"jerry.xuddd" <je********@discussions.microsoft.com> wrote in message
news:91**********************************@microsof t.com...
Hi,
I have a xml file like this
<tab>
<category name="Software" > Test purpose
<subcategory name="Software">
<method url="addSoftware.aspx">Add</method>
<method url="editSoftware.aspx">Edit</method>
<method url="searchSoftware.aspx">Search</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