J
je
Slightly newbie question: I have some XML to be transformed which
contains (inter
alia) tags containing text:
<tag>Foo</tag>
which sould appear unchanged in the transformed output. Using xopy-of
would seem
to be the thing to use. However, the enclosed text sometimes needs to
contain
HTML:
<tag>Click <a href="foo.html">here</a></tag>
At the momemt I work around this by wrapping the contents in
<html>...</html>,
and using templates like this:
<xsl:template match='tag'>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match='html'>
<xsl:copy-of select="*"/>
</xsl:template>
This means I always have to generate <tag><html> ... </html></tag>,
which strikes
me as seriously ugly. Can anyone tell me a better way to deal with
this?
TIA...
contains (inter
alia) tags containing text:
<tag>Foo</tag>
which sould appear unchanged in the transformed output. Using xopy-of
would seem
to be the thing to use. However, the enclosed text sometimes needs to
contain
HTML:
<tag>Click <a href="foo.html">here</a></tag>
At the momemt I work around this by wrapping the contents in
<html>...</html>,
and using templates like this:
<xsl:template match='tag'>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match='html'>
<xsl:copy-of select="*"/>
</xsl:template>
This means I always have to generate <tag><html> ... </html></tag>,
which strikes
me as seriously ugly. Can anyone tell me a better way to deal with
this?
TIA...