Subject: Re: [xsl] Disable Output Esacping Problems From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> Date: Wed, 06 Nov 2002 16:20:29 -0500 |
I am trying to generate an HTML file that will really be generated as an XML file and then be used as input to another XSL stylesheet (for styling purposes) where it will then be converted to a new HTML file for display in the browser. In the second XSLT file, the program goes through each <TR> and <TD> tag and adds an appropriate atribute for styling.
In the first XSLT file I need (or I think I need) to disable output esacping because I need to generate non-symmetrical XML tags. The disabling of output esacping generates the expected output, but the second XSLT file doesn't seem to recognize the <TD> and <TR> tags whose output was escaped and fails to apply the appropriate styling to these tags.
<group> <item>Item one</item> <item>Item two</item> <item>Item three</item> <item>Item four</item> </group>
<table> <tr><td>Item one</td><td>Item two</td></tr> <tr><td>Item three</td><td>Item four</td></tr> </table>
<xsl:template match="group"> <table> <xsl:apply-templates select="item"/> </table> </xsl:template>
<xsl:template match="item"> <xsl:if test="(position() mod 2) = 1"> <!-- create a tr tag before an odd item --> <xsl:text disable-output-escaping="yes"><tr></xsl:text> </xsl:if> <td> <xsl:apply-templates/> </td> <xsl:if test="(position() mod 2) != 1"> <!-- create a /tr tag after an even item --> <xsl:text disable-output-escaping="yes"></tr></xsl:text> </xsl:if> </xsl:template>
<xsl:template match="item"> <xsl:if test="(position() mod 2) = 1"> <!-- we only create output for odd items --> <tr> <td> <!-- a table cell for the odd item --> <xsl:apply-templates/> </td> <td> <!-- a table cell for the even item following --> <xsl:apply-templates select="following-sibling::item[1]/node()"/> </td> </tr> </xsl:if> </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 -> |
---|---|---|
Re: [xsl] Disable Output Esacping P, Joerg Heinicke | Thread | RE: [xsl] Disable Output Esacping P, Passin, Tom |
Re: [xsl] reading link value from e, Joerg Heinicke | Date | Re: [xsl] Disable Output Esacping P, Joerg Heinicke |
Month |