Select on multiple criteria with XPath
- by Matt Thrower
I have an XML document which looks something like this:
<meadinkent>
<record>
<comp_div>MENSWEAR</comp_div>
<sty_ret_type>ACCESSORIES</sty_ret_type>
<sty_pdt_type>BELTS</sty_pdt_type>
<pdt_category>AWESOME_BELTS</pdt_category>
</record>
<medinkent>
I want to useXPath to select nodes which match all four elements and I'm having trouble getting the boolean syntax right. I'm trying this to match the first two just as a test:
"/meadinkent/record/comp_div[.='" & comp_div & "'] and /meadinkent/record/sty_ret_type[.='" & sty_ret_type & "']"
Which is failing, saying no nodes are returned. Obviously I'm being very stupid - what am I doing wrong?
Cheers,
mAtt