This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: How is this part of the XSLT specification to be interpreted?
- To: xsl-list at mulberrytech dot com
- Subject: Re: How is this part of the XSLT specification to be interpreted?
- From: Warren Hedley <w dot hedley at auckland dot ac dot nz>
- Date: Tue, 20 Jun 2000 12:04:15 -0400
- Organization: Department of Engineering Science, The University of Auckland
- References: <44F0B703A897D311B4410008C7DF7068764AC4@exchange.stibo.dk>
- Reply-To: xsl-list at mulberrytech dot com
Thorbjørn Ravn Andersen wrote:
>
> My goal is documentation on a higher level than <!-- comment --> and JavaDoc. Can it be done as a valid XSLT-file?
Don't write off <!-- comment -->. You can put structured documentation inside
of comments and then use XSLT to extract it into a more meaningful context.
The following isn't tested. It's not elegant, but it should work.
Input:
<!--
<h1>Documentation</h1>
<p>Here's some text.</p>
-->
XSL:
<xsl:template match="/">
<html>
<head><title>Docs</title></head>
<body>
<xsl:apply-templates select="//comment()" />
</body>
</html>
</xsl:template>
<xsl:template match="comment()">
<xsl:if test="starts-with(., 'doc')">
<xsl:value-of disable-output-escaping="yes" select="." />
</xsl:if>
</xsl:template>
--
Warren Hedley
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list