Subject: Re: [xsl] Setting Namespace on Generated xsl:stylesheet Element From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx> Date: Mon, 25 Jan 2010 21:50:34 +0530 |
I'm using a stylesheet (A.xsl) to generate another stylesheet (B.xsl). B.xsl will process Atom feeds and thus needs to reference the atom namespace. Consequently, B.xsl needs a namespace declaration in the xsl:stylesheet element:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:atom="http://www.w3.org/2005/Atom">
To generate the xsl:stylesheet element in B.xsl, I have the following excerpt in A.xsl:
<xsl:element name="xsl:stylesheet"> <xsl:namespace name="atom">http://www.w3.org/2005/Atom</xsl:namespace> <xsl:attribute name="version">1.0</xsl:attribute> ... </xsl:element>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xslo="dummy">
<xsl:template .... <xslo:stylesheet version="1.0" xmlns:atom="http://www.w3.org/2005/Atom"> ..... </xslo:stylesheet> </xsl:template>
My understanding is that the xsl:namespace element in this excerpt is only valid in XSLT 2.0. I tried:
<xsl:attribute name="xmlns:atom">http://www.w3.org/2005/Atom</xsl:attribute>
but Saxon told me:
Error at xsl:attribute on line 22 column 40 of QueryToFeedFilter.xsl: XTDE0850: Invalid attribute name: {xmlns:atom} Failed to compile stylesheet. 1 error detected.
Using XSLT 1.0, is there a way of generating the xsl:stylesheet element that needs to be in B.xsl?
-- UBL and Code List training: Copenhagen, Denmark 2010-02-08/10 XSLT/XQuery/XPath training after http://XMLPrague.cz 2010-03-15/19 XSLT/XQuery/XPath training: San Carlos, California 2010-04-26/30 Vote for your XML training: http://www.CraneSoftwrights.com/s/i/ Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video Video lesson: http://www.youtube.com/watch?v=PrNjJCh7Ppg&fmt=18 Video overview: http://www.youtube.com/watch?v=VTiodiij6gE&fmt=18 G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Male Cancer Awareness Nov'07 http://www.CraneSoftwrights.com/s/bc Legal business disclaimers: http://www.CraneSoftwrights.com/legal
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Setting Namespace on Generate, Roger L. Cauvin | Thread | [xsl] Update Available for Intel SO, Davoli, Russell J |
[xsl] Setting Namespace on Generate, Roger L. Cauvin | Date | Re: [xsl] Is there a forum frontend, List Owner |
Month |