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

RE: Repost: How to make namespace declarations all glo

Subject: RE: Repost: How to make namespace declarations all global (i.e. in root element)
From: "Wes Kubo" <wkubo@xxxxxxxxxxxxx>
Date: Thu, 8 Aug 2002 11:19:13 -0700
xsl create namespace
Michael.

Thanks for the fix. I had to change it slightly to:

  	<xsl:copy-of
select="document('fooNamespace.xml')//namespace::*[.='http:www.example.com/f
oo']"/>
	or
	<xsl:copy-of
select="document('fooNamespace.xml')//namespace::foo[.='http:www.example.com
/foo']"/>

(added  the '*' or 'foo' after the namespace axis) to actually select the
nodes.

In answer to your question:
	Basically, the receiving application is coded to expect to see all the
namespaces declared as global namespaces (i.e. in the root element). This is
a noted bug.

Btw, I own XSLT - 2nd Edition and it's a great reference.

Thanks again.

Wes

-----Original Message-----
From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
[mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Michael Kay
Sent: Thursday, August 08, 2002 9:46 AM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE:  Repost: How to make namespace declarations all global
(i.e. in root element)


You can get a namespace node onto an element that doesn't actually need
it by copying the namespace node from another document.

<xsl:element name="rootElement">
  <xsl:copy-of select="//namespace::[.='http:www.example.com/foo']"/>

This is defined in an erratum to XSLT 1.0.

In XSLT 2.0 there is an <xsl:namespace> instruction to achieve this
effect.

I would be interested to know why your receiving application expects to
find a namespace declaration on an element that doesn't need it.

Michael Kay
Software AG
home: Michael.H.Kay@xxxxxxxxxxxx
work: Michael.Kay@xxxxxxxxxxxxxx



 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.