This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: Checking whether node value is string or not.
- From: "Michael Kay" <michael dot h dot kay at ntlworld dot com>
- To: <xsl-list at lists dot mulberrytech dot com>
- Date: Thu, 30 May 2002 15:18:48 +0100
- Subject: RE: [xsl] Checking whether node value is string or not.
- Reply-to: xsl-list at lists dot mulberrytech dot com
>
> Is it possible to check the value of a node ...I mean if it
> is string then it allow it in result document otherwise discard it.
>
> <Node>Johan</Node>
> <Node>Smith</Node>
> <Node>123Johan</Node>
> <Node>Johan123</Node>
> <Node>123456</Node>
> <Node>Sarah</Node>
All the above are strings. From your example, I guess you want to
exclude strings that include digits. You can test whether a string
contains digits using
contains(translate($x, '012345678', '9'), '9')
Michael Kay
Software AG
home: Michael.H.Kay@ntlworld.com
work: Michael.Kay@softwareag.com
>
> After conversion
>
> <ResultNode>Johan</ResultNode>
> <ResultNode>Smith</ResultNode>
> <ResultNode/>
> <ResultNode/>
> <ResultNode/>
> <ResultNode>Sarah</ResultNode>
>
>
>
> Thanks
>
> Mukul
>
>
>
>
>
> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
>
>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list