Subject: [xsl] RE: Setting Namespace on Generated xsl:stylesheet Element From: "Roger L. Cauvin" <roger@xxxxxxxxxx> Date: Wed, 27 Jan 2010 05:00:23 -0600 |
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 |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] RE: Setting Namespace on , Andrew Welch | Thread | [xsl] Fw: [saxon] Loading collation, Mark Wilson |
Re: [xsl] Inserting XML into styles, Hermann Stamm-Wilbra | Date | [xsl] [ANN] XML Prague 2010 Speaker, Jim Fuller |
Month |