xpath doesn't support substring !

View: New views
2 Messages — Rating Filter:   Alert me  

xpath doesn't support substring !

by Le Mai Tung :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello there,
I got one comment
I want to select the node whose value contains a substring.
For eg:

<Data>
<ID>1</ID>
<Name>Abramson, Norman</Name>
</Data>

I want to select the <Name> node containing "Abramson" , so I cannot use the = operator, but I found no "substring" command. I must query all nodes, check them all, kind of lengthy job !
Hope to get this feature someday, thanks for reading.


life is not only 17 inches

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com


RE: xpath doesn't support substring !

by Michael Kay-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

XPath has functions substring(), substring-before(), and starts-with(), which between them should meet your requirements. I don't know how you missed these.
 
Michael Kay
http://www.saxonica.com/


From: www-xpath-comments-request@... [mailto:www-xpath-comments-request@...] On Behalf Of Le Mai Tung
Sent: 23 May 2006 04:27
To: www-xpath-comments@...
Subject: xpath doesn't support substring !

Hello there,
I got one comment
I want to select the node whose value contains a substring.
For eg:

<Data>
<ID>1</ID>
<Name>Abramson, Norman</Name>
</Data>

I want to select the <Name> node containing "Abramson" , so I cannot use the = operator, but I found no "substring" command. I must query all nodes, check them all, kind of lengthy job !
Hope to get this feature someday, thanks for reading.


life is not only 17 inches

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com