cancel
Showing results for 
Search instead for 
Did you mean: 

XPath question

ananius
Champ in-the-making
Champ in-the-making
Hi,

Can anybody say why this query doesn't find anything:

//xx:someDocument[/someNode/@xx:text='DOCUMENT_TITLE']

but this does:

//xx:someDocument/someNode[@xx:text='DOCUMENT_TITLE']/..

The reason why I need the upper kind of syntax is because actually I need to find xx:someDocuments based on multiple child node conditions. So I need to do something like this in the end, but even the simpler case doesn't work (upper example, no errors, it just doesn't find anything):

//xx:someDocument[/someNode/@xx:text='?'][/someOtherNode/@xx:number=?]
2 REPLIES 2

andy
Champ on-the-rise
Champ on-the-rise
Hi

You are working in absolute paths from the root node ….try ….

//xx:someDocument[./someNode/@xx:text='?' or someOtherNode/@xx:number=?]‍‍‍

Regards

Andy

ananius
Champ in-the-making
Champ in-the-making
Oh yes indeed.. thanks a lot, now it works like train toilet (finnish saying) Smiley Happy