Structured metadata within XSLT?

Subject: Structured metadata within XSLT?
From: Ed Staub <estaub@xxxxxxxx>
Date: Mon, 13 Nov 2000 09:51:52 -0500
I'm interested in adorning stylesheets with structured information about

For instance, a template might include documentation about its intended
usage, structured in such a way that it could be processed by parsing the
stylesheet.  This could be of great use in providing better tools for using

AFAIK, the only "official" mechanism for including metadata in a stylesheet
	<!-- comment -->
This obviously doesn't support XML-based structure within it.

I believe that "phantom" unimplemented extension elements can be used to
provide structure, if a null <xsl:fallback/> is provided with each use.  For

<xsl:template name="adder">
	<xsl:param name="addend1"/>
	<xsl:param name="addend2"/>
	<myspace:templateDoc>   <!-- myspace is an extension element prefix
		<description>Adds two numbers together.>
			<param name="addend1" type=xsd:integer>First number
to add.</param>
			<param name="addend2" type=xsd:integer>Second number
to add.</param>
		<result>The sum is output as an integer.</result>
	<xsl:value-of select="$addend1 + $addend2"/>	<!-- much ado about
very little -->

I believe this is a hack; I would very much prefer that XSLT provide generic
elements specifically for metadata.  Something like W3C Schema's
<annotation>,<appinfo>, and <documentation> elements would be sufficient;

I have two questions:

1.) Can anyone see any problems with the extension-element-based usage
pattern in the example?

2.) Is anyone on the W3C XSL WG supportive enough of this notion to
recommend that the WG add "encapsulating metadata" (or similar) to the XSLT
Version 2 requirements?


-Ed Staub

 XSL-List info and archive:

Current Thread