This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Structured metadata within XSLT?
- To: Ed Staub <estaub at kana dot com>
- Subject: Re: Structured metadata within XSLT?
- From: Francis Norton <francis at redrice dot com>
- Date: Tue, 14 Nov 2000 10:17:12 +0000
- CC: "'xsl-list at mulberrytech dot com'" <xsl-list at mulberrytech dot com>
- References: <B7EE31F81D42D41197D200D0B74D4AE101A21E5E@mht-ex1.silknet.com>
- Reply-To: xsl-list at mulberrytech dot com
Ed Staub wrote:
>
> The metadata should be ignored by the XSLT processor - I don't want it
> emitted into the output stream whenever the template is run. Finding a way
> to express metadata is easy - it's finding one which is coherent with XSLT
> that's hard.
>
Two solutions (other than the extension element / fallback solution) -
first XSLT seems to ignore non-XSLT elements within the template element
- at least both Saxon and MSXML3 do, and I assume that this is what is
referred to by "non-xsl-top-level" in the XSLT DTD.
The second, and more interesting solution, is not to have the XSLT
processor crudely ignore the metadata, but create your own metadata
namespace, eg metadata.edstaub.com, and embed the metadata in XSLT
constructs which may get processed but only if you are using the
stylesheet in some kind of metadata mode.
So here you could have
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0"
xmlns:s="http://metadata/edstaub.com"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<xsl:output indent="yes"/>
<xsl:template match="/">
<!-- normal processing -->
<xsl:apply-templates/>
</xsl:template>
<!-- some metadata -->
<xsl:template match="/s:metadata">
<rdf:RDF >
<rdf:Description about="this.stylesheet.xslt">
<!-- describe templates and parameters -->
</rdf:Description>
</rdf:RDF>
</xsl:template>
</xsl:stylesheet>
so that using the stylesheet to process the (minimal) document
<metadata xmlns="http://metadata/edstaub.com"/>
would get the stylesheet to regurgitate its metadata.
Another approach would be to use a global variable to switch off (or on)
metadata held in xsl:if elements - this would be useful for emitting
profiling data in a separate namespace.
I think the Big Question [tm] is what do you want to do with the
metadata - for example:
[0] human readable
[1] machine readable by structured report device (eg HTML)
[2] machine readable by type-checker
Interesting...
Francis.
--
Francis Norton.
why not?
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list