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

RE: Generating a namespace declaration

Subject: RE: Generating a namespace declaration
From: "Michael Kay" <mhk@xxxxxxxxx>
Date: Mon, 1 Dec 2003 12:44:09 -0000
xsl namespace declaration
> using <xsl:element>, is it possible to declare a namespace 
> prefix. I tried specifying "xmlns:myns" as an attribute ( 
> <xsl:attribute> ), but the processor complained.
> 
> I d rather not use any extensions.
> 
> Do I have to resort to LREs for this.
> 

If the namespace you want to declare is actually used by the element
name or by one of its attributes, then you can use the namespace
attribute of <xsl:element> or <xsl:attribute> to create the node in the
right namespace, and the namespace declarations will be added
automatically by the serializer.

If you want to add a namespace node that isn't used in any element or
attribute name it's a bit trickier. XSLT 2.0 allows you to do it with an
xsl:namespace instruction. In XSLT 1.0, the only way is to copy a
namespace node (using <xsl:copy>) either from the source document or
from a temporary tree.

Michael 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.