[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] xsl/xslt coding standard


Subject: Re: [xsl] xsl/xslt coding standard
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Sat, 17 Aug 2002 12:04:12 +0100

Jim,

> I think Jeni's suggestion of adding to xsl:stylesheet doesnt make
> any sense...for example if your document is HTML format; what
> happens if you also use HTML namespace in a literal result
> element...as part of your result tree ?

You wrap the HTML in an element that isn't HTML and mark that
wrapper element's namespace as being the documentation element
namespace:

<xsl:stylesheet version="2.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:doc="http://www.example.com/documentation"
                xmlns="http://www.w3.org/1999/xhtml"
                documentation-element-prefixes="doc">

<xsl:template match="/">
  <doc:doc>
    <p>This is the <em>main template</em>...</p>
  </doc:doc>
  ...
</xsl:template>
                
</xsl:stylesheet>

> Also meta data, such as doc, should be able to live on its on, after
> any kind of extraction or transform process (....something like
> Xinclude or even non-xml processing )...which means that putting
> this data in the enclosing stylesheet element as an attribute is not
> a precise enough resolution....though admittedly it would be a pain
> to have to explicitly add namespace declaration to each <meta:doc/>
> tag.

You mean that having a processor extracting documentation from a
stylesheet would have trouble identifying it because it would have to
parse the documentation-element-prefixes attribute in order to work
out which namespace(s) it should be looking at?

I guess that's true, but I was thinking that most
documentation-generating tools would have their own namespace for the
documentation that they extracted, and would thus know in advance
which elements they'd want to extract; I wasn't imagining that there'd
be general documentation-extraction tools that could take any
documentation-oriented markup language known to humankind and
transform that into something readable.

But having said all that, I'm perfectly at ease with a xsl:doc element
or something similar, as long as it doesn't constrain what I put
inside it.

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list



Current Thread
Keywords