[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Partial Implementation of XInclude include element

Subject: Re: Partial Implementation of XInclude include element
From: Jeni Tennison <jeni@xxxxxxxxxxxxxxxx>
Date: Wed, 25 Sep 2002 23:27:59 +0100
saxon xinclude
Hi Eliot,

> Here's what I'm observing: when using Stylus Studio 4.5 beta (which
> enables Saxon as a debugging XSLT engine), if I use Saxon to do the
> transform, then Saxon copies all the namespace declarations from the
> xsl:stylesheet element to the root element of the output doucment.
> If I use the built-in XSLT engine, no copying.
>
> So: which behavior is more correct? Or have I inadvertantly turned
> on a convenience feature of Saxon?

It's hard to tell without seeing your stylesheet, but I would guess
that Saxon is doing the right thing (it usually does) and that you
have something like:

<xsl:template match="/*">
  <fo:root>
    ...
  </fo:root>
</xsl:template>

When you create an element using a literal result element (as above),
then the element you create has to have the same namespaces in scope
as the element in the stylesheet. The <fo:root> literal result element
has in scope all the namespaces that are declared on the
<xsl:stylesheet> element (as well as those on its parent
<xsl:template> element and itself), so the element in the result has
these namespaces as well.

If, on the other hand, you're doing:

<xsl:template match="/*">
  <xsl:copy>
    ...
  </xsl:copy>
</xsl:template>

(which is what I assumed, since you seemed to be doing an XInclude
pre-process) then you shouldn't get any namespaces from the
<xsl:stylesheet> element coming through into the result document.
That's because <xsl:copy> takes the element node from the *source*
document and copies it.

Also, if you're doing:

<xsl:template match="/*">
  <xsl:element name="fo:root">
    ...
  </xsl:element>
</xsl:template>

then you shouldn't get any namespace nodes from the <xsl:stylesheet>
element being copied through.

Oh, I should point out that no matter how you create the <fo:root>
element, it should have the correct XSL-FO namespace declaration for
the 'fo' prefix on it. Any processor that generates a result document
that isn't namespace-valid is definitely in error.

Cheers,

Jeni

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


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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.