xml - XPath with multiple values for same element -
i'm writing xpath query xml file following structure
<products> <product> <id></id> <categories> <category>38</category> <category>41</category> <category>43</category> </categories> </product> </products> i able products matching ids 41 or 43 this
products/product[categories/category[. = '43' or . = '41']] i need products matching both ids 41 & 43 , doesn't work
products/product[categories/category[. = '43' , . = '41']] what doing wrong? thank in advance.
you can use:
products/product[ categories[category='43'] [category='41'] ] product categories containing both category 43 , category 41
Comments
Post a Comment