RE: xpath doesn't support substring !
"Michael Kay" <[email protected]> Wed, 24 May 2006 09:40:57 +0100
| Newsgroups | gmane.text.xml.xpath.general |
|---|---|
| Message-ID | <00a601c67f0d$c8771e70$1a09010a@turtle> |
This is a multi-part message in MIME format. ------=_NextPart_000_00A7_01C67F16.2A3B8670 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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: [email protected] [mailto:[email protected]] On Behalf Of Le Mai Tung Sent: 23 May 2006 04:27 To: [email protected] 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 ------=_NextPart_000_00A7_01C67F16.2A3B8670 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=3DContent-Type content=3D"text/html; = charset=3Dus-ascii"> <META content=3D"MSHTML 6.00.2900.2873" name=3DGENERATOR></HEAD> <BODY> <DIV dir=3Dltr align=3Dleft><SPAN class=3D140054008-24052006><FONT = face=3DArial=20 color=3D#0000ff size=3D2>XPath has functions substring(), = substring-before(), and=20 starts-with(), which between them should meet your requirements. I don't = know=20 how you missed these.</FONT></SPAN></DIV> <DIV dir=3Dltr align=3Dleft><SPAN class=3D140054008-24052006><FONT = face=3DArial=20 color=3D#0000ff size=3D2></FONT></SPAN> </DIV> <DIV dir=3Dltr align=3Dleft><SPAN class=3D140054008-24052006><FONT = face=3DArial=20 color=3D#0000ff size=3D2>Michael Kay</FONT></SPAN></DIV> <DIV dir=3Dltr align=3Dleft><SPAN class=3D140054008-24052006><FONT = face=3DArial=20 color=3D#0000ff = size=3D2>http://www.saxonica.com/</FONT></SPAN></DIV><BR> <BLOCKQUOTE dir=3Dltr=20 style=3D"PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px = solid; MARGIN-RIGHT: 0px"> <DIV class=3DOutlookMessageHeader lang=3Den-us dir=3Dltr align=3Dleft> <HR tabIndex=3D-1> <FONT face=3DTahoma size=3D2><B>From:</B> = [email protected]=20 [mailto:[email protected]] <B>On Behalf Of </B>Le Mai=20 Tung<BR><B>Sent:</B> 23 May 2006 04:27<BR><B>To:</B>=20 [email protected]<BR><B>Subject:</B> xpath doesn't support = substring=20 !<BR></FONT><BR></DIV> <DIV></DIV>Hello there, <BR>I got one comment <BR>I want to select the = node=20 whose value contains a substring.<BR>For eg:=20 <BR><BR><Data><BR><ID>1</ID> = <BR><Name>Abramson,=20 Norman</Name> <BR></Data><BR><BR><!-- / message --><!-- = controls -->I want to select=20 the <Name> node containing "Abramson" , so I cannot use the =3D = operator,=20 but I found no "substring" command. I must query all nodes, check them = all,=20 kind of lengthy job !<BR>Hope to get this feature someday, thanks for=20 reading.<BR><BR><BR>life is not only 17 inches <P>__________________________________________________<BR>Do You=20 Yahoo!?<BR>Tired of spam? Yahoo! Mail has the best spam protection = around=20 <BR>http://mail.yahoo.com </P></BLOCKQUOTE></BODY></HTML> ------=_NextPart_000_00A7_01C67F16.2A3B8670--