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

RE: Problem: namespace declaration in output document

Subject: RE: Problem: namespace declaration in output document
From: "Michael Kay" <mhkay@xxxxxxxxxxxx>
Date: Wed, 26 Sep 2001 12:32:49 +0100
xsl problem namespaces
> Now, I have
> the following problem with the namespace declaration:
>
> The wsdl document must look like this:
>
> <definitions name="xyz" targetNamespace="xyz" xmlns:tns="X">
> ...
> </definitions>
>
> where X is the name of the created wsdl document.
>

There are two ways to get a namespace declaration in the result document:
(a) output an element or attribute that relies on this namespace declaration
(b) copy a namespace node from the source document or the stylesheet

If you can put up with dummy attributes in the output, the simplest solution
is to rely on (a):

<xsl:attribute name="dummy" namespace="{-- your namespace here-- }"/>

If not, you have to fall back on (b), which relies on using <xsl:copy> on
namespace nodes, a feature which is defined only in the XSLT 1.0 errata and
may therefore not work with all processors. Also, if the namespace is
generated dynamically form the stylesheet, you need to use the xx:node-set()
extension function:

<xsl:variable name="rtf">
  <xsl:element name="my:dummy" namespace="{-- your namespace here-- }"/>
</xsl:variable>

<definitions>
  <xsl:copy select="xx:node-set($rtf)/*/namespace::my"/>
  <xsl:attribute name="name">xyz</xsl:attribute>

etc.

Mike Kay


 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.