Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple [not(contains(id, ...))] in SimpleXML (xPath)

I need to exclude multiple ids from the XML list and I was wondering how to make the script to work.

I have something like this

//Réponses[not(contains(Constituent_x0020_ID, "34282,35224,34094"))] Not working

//Réponses[not(contains(Constituent_x0020_ID, "34282"))] Working

So what's the correct syntax to use if we want to filter multiple ids so my first exemple works ?

Update

This

//Réponses[not(contains(Constituent_x0020_ID, "34282"))][not(contains(Constituent_x0020_ID, "35224"))][not(contains(Constituent_x0020_ID, "34094"))]

Seems to be working but it's kind of .... too long. Any smaller solution ?

like image 219
Warface Avatar asked Nov 01 '25 17:11

Warface


1 Answers

I don't think there's a great solution here, but this would be marginally shorter:

//Réponses[not(Constituent_x0020_ID[contains(., "34282") or contains(., "35224") or contains(., "34094")])]
like image 72
JLRishe Avatar answered Nov 03 '25 20:11

JLRishe