Question

I am importing products into an online store from an XML document. There is the option to filter using xpath.

I would like to exclude certain products based on brand.

I have:

<PRODUCT ITEM="12797">
 <BRAND>Boxer Games</BRAND>
 <INCATNAME>Hen And Stag Nights</INCATNAME>
</PRODUCT>

<PRODUCT ITEM="12798">
 <BRAND>Silly Games</BRAND>
 <INCATNAME>Hen And Stag Nights</INCATNAME>
</PRODUCT>

I understand I can use "/product[brand=silly games]" to select the node, but how can I then skip/ignore it?

Was it helpful?

Solution

How about this way :

//PRODUCT[BRAND != 'Silly Games']
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top