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

Selecting and printing certain nodes

Subject: Selecting and printing certain nodes
From: "Glenn MacGregor" <gtm@xxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 19 Feb 2004 16:02:20 -0500
xsl print all nodes
Hi All,

I am having a problem printing certain nodes to the result tree. Here is
the XML I am working on:

...
<tr><td><b>Before</b> After Variable</td/</tr>
...

I have it to the point where I am printing the <tr>,<td> and <b> tags. The
problem is the result is:
<tr><td><b></b></td></tr>  Where did all my text go?

XSL:
<xsl:template name="foreachOutput">
    <xsl:param name="cdata"/>
    <xsl:param name="do-sect"/>
    <xsl:for-each select="$do-sect">
        <xsl:choose>
            <xsl:when test="name() = 'variable'">
                <xsl:call-template name="insertVariable">
                    <xls:with-param name="var" select="$data"/>
                </xsl:call-template>
            </xsl:when>
            <xsl:otherwise>
                <xsl:element name="{name()}">
                    <xsl-copy-of select="@*"/>
                    <xsl:call-template name="foreachOutput">
                        <xsl:with-param name="do-sect" select="./*"/>
                        <xsl:with-param name="cdata" select="$cdata"/>
                    </xsl:call-template>
                </xsl:element>
            </xsl:otherwise>
        </xsl:choose>
    <xsl:for-each>
</xsl:template>

>From the above snipit of XML (<tr><td>...) I assume I am not getting into
the <xsl:when test="name()='variable'"> section so I am in the
<xsl:otherwise> which uses the <xsl:element> I assume that is where my
problem lies but I can't figure out how to get around it to print all the
text as well as the elements.

    Thanks

            Glenn


 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.