[xsl] Selecting and printing certain nodes

Subject: [xsl] Selecting and printing certain nodes
From: "Glenn MacGregor" <gtm@xxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 19 Feb 2004 16:02:20 -0500
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:template name="foreachOutput">
    <xsl:param name="cdata"/>
    <xsl:param name="do-sect"/>
    <xsl:for-each select="$do-sect">
            <xsl:when test="name() = 'variable'">
                <xsl:call-template name="insertVariable">
                    <xls:with-param name="var" select="$data"/>
                <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"/>

>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.



 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Current Thread