Subject: Re: [xsl] Selecting and printing certain nodes From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> Date: Thu, 19 Feb 2004 16:43:40 -0500 |
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>
<xsl:template match="node()"> <xsl:copy> <xsl:copy-of select="@*"/> <xsl:apply-templates/> </xsl:copy> </xsl:template>
Cheers, Wendell
====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Selecting and printing certai, Glenn MacGregor | Thread | Re: [xsl] Selecting and printing ce, Glenn MacGregor |
[xsl] Re: The Solution (Was: Re: ex, Dimitre Novatchev | Date | Re: [xsl] Selecting and printing ce, David Carlisle |
Month |