View Single Post
  #1 (permalink)  
Old May 14th, 2008, 10:48 AM
mphare mphare is offline
Friend of Wrox
Points: 470, Level: 7
Points: 470, Level: 7 Points: 470, Level: 7 Points: 470, Level: 7
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2004
Location: Plano, TX, USA.
Posts: 109
Thanks: 18
Thanked 0 Times in 0 Posts
Default undeclare-namespaces directive

I'm using Saxon8B within the Oxygen XML IDE.
I'm also neck deep in having to deal with <!ENTITY ...> references because my XML source came from heavily SGML'd Framemaker, and they still use <!ENTITY ...> for referencing bitmaps.

So I'm using the saxon extensions for generating these items.

But the problem is that I've defined the namespaces for the saxon extensions and the dtd extensions and these namespaces are showing up in my result tree.

In "XSLT 2.0" on or about page 114 in Capter 3, section "Namespaces for a Literal Result Element" there is a note that one can use:

 
Quote:
quote:<xsl:output method="xml" version="1.1" undeclare-namespaces="yes"/>


and then use something like:

 
Quote:
quote:<img xmlns:saxon="" xmlns:dtd="" href="{unparsed-entity-uri(.)}"></img>


to remove these unwanted and unneeded namespaces in the result.

Problem is I'm getting an error:

 
Quote:
quote:Severity and Description Path Resource Location Creation Time Id
Quote:
[Saxon8B] Attribute @undeclare-namespaces is not allowed on element <xsl:output>
@see: http://www.w3.org/TR/xslt20/#err-XTSE0090
The w3c link confirms this to be a static error and further indicates to use exclude-result-prefixes attributes to stop the unwanted namespaces in the result tree.

However, I declared the extension namespaces on the global <xsl:stylesheet> element. I don't seem to be able to add the exclude-result-prefixes to the global element.

How else can I remove these unwanted namespaces from my result tree?


------------------------
GnuPG Key fingerprint = 1AD4 726D E359 A31D 05BF ACE5 CA93 7AD5 D8E3 A876

Michael Hare
__________________
------------------------
Keep Moving Forward

GnuPG Key fingerprint = 1AD4 726D E359 A31D 05BF ACE5 CA93 7AD5 D8E3 A876

Michael Hare
Reply With Quote