XPath question
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2006 07:02 AM
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=?]
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=?]
Labels:
- Labels:
-
Archive
2 REPLIES 2

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2006 09:37 AM
Hi
You are working in absolute paths from the root node ….try ….
Regards
Andy
You are working in absolute paths from the root node ….try ….
//xx:someDocument[./someNode/@xx:text='?' or someOtherNode/@xx:number=?]
Regards
Andy
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2006 09:52 AM
Oh yes indeed.. thanks a lot, now it works like train toilet (finnish saying)

