xpath

wxdqz

New Member
i have the following xml file

<gallery>
<series id="1"/>
<series id="2"/>
<image id="1"/>
<image id="2"/>
<note id="1"/>
....
</gallery>

i want to return a single node (<gallery>) using the selectSingleNode, where all the childnodes contain the attribute id="1" ie;

<gallery>
<series id="1"/>
<image id="1"/>
<note id="1"/>
</gallery>

if i use the following

objXMLDoc.selectSingleNode("gallery/*[@id='1'] ")

i only get the first child node with the id="1" attribute. Is there any way i can select the Gallery Node, but with all child nodes which have the id="1" attribute.

the reason i want to do this is so that i can use transformNode ( objXMLDoc.transformNode(objXSLDoc) ) to transform the filtered node into HTML.

please excuse my hogging this resource but i have reached a deadend regarding this problem.
 
Back
Top