RE: [xsl] Checking whether node value is string or not.

Subject: RE: [xsl] Checking whether node value is string or not.
From: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx>
Date: Thu, 30 May 2002 15:18:48 +0100
> 
> 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@xxxxxxxxxxxx
work: Michael.Kay@xxxxxxxxxxxxxx 
> 
> 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


Current Thread