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

Re: Re: Forcing namespaces to root element of output X

Subject: Re: Re: Forcing namespaces to root element of output XML
From: David Carlisle <davidc@xxxxxxxxx>
Date: Wed, 20 Jul 2005 14:32:51 +0100
remove unnecessary namespaces
[removing xalan-j-users@xxxxxxxxxxxxxx from CC]

> Unfortunately XSLT 1.0 doesn't have anything like an <xsl:namespace>
> directive. The standard workarounds are to generate unnecessary attributes
> in the desired namespaces to force their declaration (not acceptable for
> many users), or to build a node in a Result Tree Fragment which uses the
> namespace, then xsl:copy the namespace node off that RTF to put it where
> you want it (obscure and a bit ugly, but pretty much a standardized
> solution). XSLT 2.0 has promised to make this easier.

You only need to do this though if the namespace is not known at the
time the stylesheet is written. If it is a fixed namespace known in the
stylesheet you don't need the (missing) xsl:namespace functionality,
just declare the namespace (eg on xsl: stylesheet) and then use a
literal result element rather than xsl:element to generate the top level
element. A common reason for wanting to use xsl:element rather than a
literal result element is to stop this namespace copying in cases where
you don't want the namespace in the result.

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

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.