Node selection by value using MSXML

Hello, everyone.

I have question about using selectnodes and XPath queries with MSXML to obtain a node collection based on value and not name.

Consider the following, simplified document:
Code:

<TIER0>
<TIER1>
<TIER2>
A
</TIER2>
<TIER2>
B
</TIER2>
<TIER2>
B
</TIER2>
</TIER1>
<TIER1>
<TIER2>
B
</TIER2>
<TIER2>
C
</TIER2>
<TIER2>
C
</TIER2>
</TIER1>
</TIER0>

Is there a way to set a IXMLDOMNodeList so that it extracts only those nodes which have a certain value? If, for example, I wanted to extract only nodes which contained the value "B" would there be something along the lines of:
Code:

set SomeNodeList = SomeXMLDocument.selectNodes("[contains(??,'B')]")

I know the above code is wrong, but it's just there to show you how I'm doing it wrong, and I have no idea how I'm supposed to do it right.

Thanks.
[1249 byte] By [cunnus88] at [2007-11-19 13:29:24]
# 1 Re: Node selection by value using MSXML
Something like

set SomeNodeList = SomeXMLDocument.selectNodes("//*[contains(text(),'B')]")

Should do.
khp at 2007-11-10 3:27:20 >
# 2 Re: Node selection by value using MSXML
That worked perfectly fine.

Thank you very much.
cunnus88 at 2007-11-10 3:28:20 >