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

Re: [xsl] XInclude in Cocoon


Subject: Re: [xsl] XInclude in Cocoon
From: Jeni Tennison <mail@xxxxxxxxxxxxxxxx>
Date: Wed, 7 Feb 2001 09:48:42 +0000

Bill Humphries wrote:
> The xinclude folder in the examples walks you through this.

The syntax that they use doesn't seem to be in sync with the current
(26 October 2000) Working Draft.  They use:

   <include xinclude:parse="text" xinclude:href="foo.txt"/>

rather than:

   <xinclude:include parse="text" href="foo.txt"/>

I haven't read the WD closely enough to know whether this is a simple
syntax difference: perhaps there's some special doohickey that means
that attributes on an xinclude:include element are automatically
assumed to be in the XInclude namespace.

I haven't managed to 'activate' an XInclude within an XSLT stylesheet
that's being applied to some XML source as yet (e.g. include a CSS
file in the stylesheet using XInclude), but that may well be just
because my installation is screwy (the other includes I try throw an
error - it's only the fact that this one *doesn't* that makes me think
that it isn't being picked up) - if anyone manages to do that, can
they post how?

----

But thinking about it, isn't there an interesting issue with
XIncludes in XSLT? If an XSLT processor is presented with:

<xsl:template match="/">
   <foo>
      <xinclude:include href="foo.xml" />
   </foo>
</xsl:template>

How does the processor know whether the xinclude:include should be
activated during the parse of the XSLT stylesheet or whether the
include element should be copied to the result tree?

>From the sounds of XInclude, I guess that processing the include
elements is a pretty low-level feature of an XML processor, and that
the stylesheet's DOM will include the external file.

Which means that to *create* an include element in the result, you'd
have to use the xsl:element instruction *or* use a namespace alias. In
other words, elements and attributes that are dealt with by low-level
XML processors have to be generated with the same techniques as XSLT
elements and attributes. As XLink becomes supported as well,
presumably we'll run into the same issues there.
      
Cheers,

Jeni

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



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



Current Thread
Keywords