Re: Structured metadata within XSLT?

Subject: Re: Structured metadata within XSLT?
From: Francis Norton <francis@xxxxxxxxxxx>
Date: Tue, 14 Nov 2000 10:17:12 +0000

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, 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="";

  <xsl:output indent="yes"/>

  <xsl:template match="/">
    <!-- normal processing -->

  <!-- some metadata -->
  <xsl:template match="/s:metadata">
    <rdf:RDF >
      <rdf:Description about="this.stylesheet.xslt">
        <!-- describe templates and parameters -->


so that using the stylesheet to process the (minimal) document

<metadata xmlns="http://metadata/"/>

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


Francis Norton.

why not?

 XSL-List info and archive:

Current Thread