[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xsl-list
Subject:    [xsl] RE: Setting Namespace on Generated xsl:stylesheet Element
From:       "Roger L. Cauvin" <roger () cauvin ! org>
Date:       2010-01-27 11:00:23
Message-ID: 009701ca9f3f$ee257a30$ca706e90$ () org
[Download RAW message or body]

Andrew Welch <andrew.j.welch@gmail.com> 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)



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe@lists.mulberrytech.com>
--~--

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic