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

output node-set

Subject: output node-set
From: 04083259@xxxxxxxxxxxxx
Date: Fri, 1 Apr 2005 20:21:47 +0100 (BST)
xsl output node
hi

you solution worked

but as i mentioned that i need to keep some empty nodes as a reference ,
so i  just need to delete the empty nodes that called <dig >
#
#
#
#
#


First of, you XML is not valid. Second if all you need is to ignore
nodes with empty strings it can be done simpler.

    <xsl:template match="/top">
        <xsl:apply-templates/>
    </xsl:template>
    <xsl:template match="*">
        <xsl:if test="normalize-space(.) != ''">
            <xsl:copy-of select="."/>
        </xsl:if>
    </xsl:template>

#
#
#
#
#


hi

i got the following xml database result from a privious transformation
which contains some  empty nodes :


<top>
   <dig></dig>
   <MTo><MTo>
   <dig></dig>
   <dig>06767</dig>
   <dig>3712</dig>
   <CCTo><CCTo>
   <dig></dig>
   <dig>40</dig>
   <dig>48</dig>
   <dig>120</dig>
   <nondig>-000</nondig>
   <nondig>87</nondig>
   <nondig>8768</nondig>
 </top>


and i am trying from the following template to transform the above
database to a form where we get red of all the empty <dig> elements only
but it has a problem which  i can not figure what was it




 <xsl:template match="path">
 <xsl:for-each select="*">
<xsl:choose>

 <xsl:when test="'self::dig'">
 <xsl:copy-of select="dig[node()]"/>
 </xsl:when>

<xsl:when test="'self::nondig'">
 <xsl:copy-of select="nondig[node()]""/>
 </xsl:when>

<xsl:when test="'self::CCTo'">
<CCTo />
  </xsl:when>


<xsl:when test="'self::MoTo'">
<MoToTo />
  </xsl:when>

</xsl:choose>

</xsl:for-each>

 </xsl:template>
 </xsl:stylesheet>

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.