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

RE: namespace declaration when generating a stylesheet

Subject: RE: namespace declaration when generating a stylesheet
From: "Seaborne, Mark" <Mark_Seaborne@xxxxxxxxxxxx>
Date: Fri, 27 Jul 2001 14:59:48 +0200
RE:  namespace declaration when generating a stylesheet
Ta muchly

I ended up with a variation on the last suggestion:

		<xsl:for-each select="$currNode/namespace::*">
			<xsl:copy-of select="."/>
		</xsl:for-each>

which does the job splendidly.

All the best

Mark Seaborne

-----Original Message-----
From: Michael Kay [mailto:mhkay@xxxxxxxxxxxx]
Sent: 27 July 2001 12:56
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE:  namespace declaration when generating a stylesheet


> I am transforming the xml document into a stylesheet via
> another stylesheet.
>
>
> The result stylesheet needs any namespace declarations that
> were in the
> source (where they will be needed).
>
> How do I get them there (using XSLT)? I am stumped.
>

Namespace nodes from the source document will be copied into the result
document when you copy an element that owns such a namespace node; they will
also be generated if you create an element or attribute that refers to the
namespace.

Apart from that, the only way to get a namespace node into the result
document is to do an <xsl:copy[-of]> on a namespace node (and even then,
only if the XSLT processor implements the latest XSLT errata). One technique
is to create a result tree fragment containing the namespace node, and copy
it from there:

<xsl:variable name="rtf">
  <xsl:element name="dummy" namespace="{$required-namespace}"/>
</xsl:variable>
<xsl:copy-of
select="xx:node-set($rtf)/dummy/namespace::*[.=$required-namespace]"/>

Mike Kay
Software AG


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

 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.