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

RE: Setting Namespace on Generated xsl:stylesheet Elem

Subject: RE: Setting Namespace on Generated xsl:stylesheet Element
From: "Roger L. Cauvin" <roger@xxxxxxxxxx>
Date: Wed, 27 Jan 2010 05:00:23 -0600
 RE: Setting Namespace on Generated xsl:stylesheet Elem
Andrew Welch <andrew.j.welch@xxxxxxxxx> wrote:

> Well, if you enjoy the pain, you can do this:
>
> <xsl:template match="/">
>   <xsl:element name="xsl:stylesheet">
>     <xsl:namespace
name="xs">http://www.w3.org/2001/XMLSchema</xsl:namespace>
>     <xsl:attribute name="version">2.0</xsl:attribute>
>     <xsl:attribute name="exclude-result-prefixes">xs</xsl:attribute>
>     <xsl:element name="xsl:template">
>       <xsl:attribute name="match">/</xsl:attribute>
>       <xsl:element name="xsl:value-of">
>         <xsl:attribute name="select">.</xsl:attribute>
>       </xsl:element>
>     </xsl:element>
>   </xsl:element>
> </xsl:template>

Ah, hurts so good :-)

Seriously, I already had a solution that used <xsl:namespace>.  I was
looking for a solution that would work in XSLT 1.0.  Ideally, the solution
would use <xsl:element> to generate elements instead of inserting them
literally, but Ken provided a solution that at least works in XSLT 1.0.

--
Roger L. Cauvin
@rcauvin (Twitter)
cauvin.blogspot.com (blog)

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.