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

Re: testing for null string in a node

Subject: Re: testing for null string in a node
From: "K. Ari Krupnikov" <ari@xxxxxxx>
Date: Mon, 06 Nov 2000 14:11:50 -0800
xml null string
If you are trying to find NAME/FN elements that have text content, you
can use

<xsl:when test="FN/text()>

-- 
K. Ari Krupnikov

DBDOM - bridging XML and relational databases
http://www.iter.co.il


mxmodi@xxxxxxxxxxxxxxx wrote:
> 
> Hi,
> 
> I want to be able to test if the value of a certain node is empty and
> depending on the result, perform more functions. I am having some troublwe
> understanding how to test for that. Any help is appreciated.
> 
> Here is the sample XML:
> 
> <root>
> <Names>
>   <Name>
>     <FN>aaa</FN>
>     <LN>bbb</LN>
>     <Dates>
>       <Date>
>         <Begin>11/11</Begin>
>         <End>12/11</End>
>            <Projects>
>               <Project>
>      <Name>proj a</Name>
>      <Code>abc-123</Code>
>               </Project>
>            ........More <Project> Nodes
>            </Projects>
>       </Date>
>        .....more <Date> Nodes
>     </Dates>
>   </Name>
>     ...........more <Name> Nodes
> </Names>
> </root>
> 
> Here is the sample XSL:
> 
> <xsl:template match="/">
> ...perform some code...
> <xsl:apply-templates select="//Names/Name" >
> <xsl:sort select="FN" />
> </xsl:apply-templates>
> </xsl:template>
> 
> <xsl: template match="Name">
> <xsl:choose>
> <xsl:when test="*[not(child::FN)]">
> ...do something...
> </xsl:when>
> <xsl:otherwise>
> ...do something else...
> </xsl:otherwise>
> </xsl:choose>
> 
> ...continue doing rest of the stuff..
> </xsl:template>
> 
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

-- 
K. Ari Krupnikov

DBDOM - bridging XML and relational databases
http://www.iter.co.il


 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.