This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
transformation does happen after copy-of?
- From: Phillip Rhodes <spamsucks at rhoderunner dot com>
- To: xsl-list at lists dot mulberrytech dot com
- Date: Sun, 21 Jul 2002 23:04:14 -0400
- Subject: [xsl] transformation does happen after copy-of?
- Reply-to: xsl-list at lists dot mulberrytech dot com
I have an well-formed html file that i need to do a transformation to. The
html file is pretty much finished, except for some elements I named
<whitespace/>
I am trying to run the html file through a transformation that will return
the html file with the <whitespace/> elements transformed to something
else. I included an example html file and my xsl file. I can invoke the
transformation, but the html file remains unchanged.
I think I must be close... can someone point out what I am doing wrong?
Thank you!!!
<?xml version="1.0" encoding="UTF-8"?>
<html>
<head>
<title>Test>/title>
</head>
<body>
(snip)
<!-- whitespace elements can be at even depth of the document,
in the body (of course), but in td,p, etc elements -->
<whitespace lines="8" inches="1.25"></whitespace>
(snip)
</body>
</html>
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="html">
<xsl:copy-of select="."/>
<xsl:apply-templates/>
</xsl:template>
<!-- since whitespace elements can be anywhere in the hierarchy, we need
to do the // -->
<xsl:template match="//whitespace[lines]">
<p/>
<p/>
</xsl:template>
</xsl:stylesheet>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list