This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: !!!showing HTML data in XML files using XSL!!!
- To: <xsl-list at lists dot mulberrytech dot com>
- Subject: RE: [xsl] !!!showing HTML data in XML files using XSL!!!
- From: "Chris Bayes" <Chris at Bayes dot co dot uk>
- Date: Fri, 30 Mar 2001 06:27:26 +0100
- Reply-To: xsl-list at lists dot mulberrytech dot com
Rosa,
You want something like this
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="*|@*">
<xsl:copy>
<xsl:apply-templates
select="@*|*|comment()|processing-instruction()|text()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="root">
<html>
<body>
<xsl:apply-templates />
</body>
</html>
</xsl:template>
<xsl:template match="text">
<xsl:apply-templates />
</xsl:template>
</xsl:stylesheet>
The important bit is the identity transform <xsl:template match="*|@*">...
This copies all elements that are not handled by other templates to the
output. You could change it to
<xsl:template match="I|i|B|b|@*"> etc for all of the html tags but I think
that is too verbose. It depends on the ballance of xml to html tags in your
input document.
Ciao Chris
XML/XSL Portal
http://www.bayes.co.uk/xml
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list