[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.
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|