[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Checking whether node value is string or not.

Subject: RE: Checking whether node value is string or not.
From: TSchutzerWeissmann@xxxxxxxxxxxxxxxx
Date: Thu, 30 May 2002 09:37:25 +0100
checking whether
Hello Mukul,
Hi Mukul,

"Johan123" is a perfectly good string, so's "123" for that matter. 

It sounds like you want to disallow any node whose value contains a number
character.
One way would be to remove any numeric characters and see if the node value
has shrunk. If it has then it had a number in it and you don't want it:

<xsl:if test="string-length(translate(.,'0123456789','')) =
string-length(.)">
	<!-- allow the node -->
</xsl:if>

hope it works,
Tom Weissmann

> -----Original Message-----
> From: Mukul.Mudgal@xxxxxxxxxxx [mailto:Mukul.Mudgal@xxxxxxxxxxx]
> Sent: 30 May 2002 07:09
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  Checking whether node value is string or not.
> 
> 
> Hello Friends
> 
> 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>
> 
> 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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.