Re: xslt2.0 feature request

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 UTC