I have a requirement to create the following structure using XSLT:
<body>
<p><span>This is a test</span></p>
</body>
Currently my "solution" (which I hope can be used) is this:
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()" />
</xsl:copy>
</xsl:template>
<xsl:template match="//body">
<body>
<xsl:text disable-output-escaping="yes"><![CDATA[</xsl:text>
<xsl:apply-templates select="@*|node()" />
<xsl:text disable-output-escaping="yes">]]></xsl:text>
</body>
</xsl:template>
I have tried the following which did not work:
<xsl:template match="foo">
<xsl:text><p></xsl:text>
<xsl:apply-templates select="@*|node()" />
<xsl:text></p></xsl:text>
</xsl:template>
Any suggestion appreciated.
No comments:
Post a Comment