RE: Structured metadata within XSLT?

Subject: RE: Structured metadata within XSLT?
From: Ed Staub <estaub@xxxxxxxx>
Date: Tue, 14 Nov 2000 08:58:35 -0500
Thanks, Francis.

> first XSLT seems to ignore non-XSLT elements within the template element

I must misunderstand you; normal behavior is to output non-XSLT elements
within a template.  Can you give a sample?

>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.

I think the "extension element / fallback" solution is probably better,
because it can be used virtually anywhere, binding metadata tightly to what
it describes.  But this is in part because of my answer to

>the Big Question [tm] ... what do you want to do with the metadata

The context is one in which there is a rich set of stylesheets with lots of
templates of the "call-template" variety.

The "hot button" is to be able to tag templates of the "call-template"
variety with metadata describing their usage, for use by authoring tools in
both automatically selecting appropriate templates and offering "tips" about
their usage.

A Javadoc-like facility would be very cool also.

-Ed Staub

-----Original Message-----
From: Francis Norton [mailto:francis@xxxxxxxxxxx]
Sent: Tuesday, November 14, 2000 5:17 AM
To: Ed Staub
Cc: 'xsl-list@xxxxxxxxxxxxxxxx'
Subject: Re: Structured metadata within XSLT?




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


Current Thread