This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Checking whether node value is string or not.


> 
> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]