W3C home > Mailing lists > Public > xsl-editors@w3.org > January to March 2002

Re: xslt2.0 feature request

From: Elliotte Rusty Harold <elharo@metalab.unc.edu>
Date: Thu, 3 Jan 2002 09:31:14 -0500
Message-Id: <p04330102b85a1a5410d2@[192.168.254.4]>
To: DPawson@rnib.org.uk, xsl-editors@w3.org
At 3:25 AM -0500 1/3/02, DPawson@rnib.org.uk wrote:
>In XSLT 1.0, in order to write a template driven stylesheet,
>I need to explicitly add a namespace to any element that I create.
>
><xsl:template match="el">
><el1 xmlns="some url">
><xsl:apply-templates/
></xsl:template>
>
>
>Is it reasonable to request that a stylesheet attribute be
>added to cause all elements to be output in a given namespace?
>

No, at least not beyond what namespace aliasing gives you now in 1.0.

Your use case is fully handled in 1.0 as follows:

<xsl:stylesheet version="1.0" xmlns:xsl=""http://yadda yadda yadda"
   xmlns="some url">

<xsl:template match="el">
   <el1>
     <xsl:apply-templates/>
   </el1>
</xsl:template>

</xsl:stylesheet>

In general literal result elements have the same namespace in the 
stylesheet they do in the output document. The only exceptions ar 
every special cases like generating XSLT from XSLT, and for these 
cases xsl:namespace-alias is fully adequate..
-- 

+-----------------------+------------------------+-------------------+
| Elliotte Rusty Harold | elharo@metalab.unc.edu | Writer/Programmer |
+-----------------------+------------------------+-------------------+
|          The XML Bible, 2nd Edition (Hungry Minds, 2001)           |
|              http://www.ibiblio.org/xml/books/bible2/              |
|   http://www.amazon.com/exec/obidos/ISBN=0764547607/cafeaulaitA/   |
+----------------------------------+---------------------------------+
|  Read Cafe au Lait for Java News:  http://www.cafeaulait.org/      |
|  Read Cafe con Leche for XML News: http://www.ibiblio.org/xml/     |
+----------------------------------+---------------------------------+
Received on Thursday, 3 January 2002 09:54:10 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 7 December 2009 10:59:52 GMT