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 11:42:46 -0500
Message-Id: <p04330105b85a36dac47f@[192.168.254.4]>
To: DPawson@rnib.org.uk, xsl-editors@w3.org
At 4:10 PM +0000 1/3/02, DPawson@rnib.org.uk wrote:
>

Thanks. Now I understand what you're asking, and I maintain it isn't 
necessary. What you're trying to do is convert elements in namespace 
A to different elements in namespace B that have the same local 
names. It's not obvious, but it can be done in XSLT 1.0 using the 
xsl:element function and attribute value templates.

You are using this template:

<xsl:template match="*">
   <xsl:copy-of select="."/>
</xsl:template>

Instead you need to use something like this template:

<xsl:template match="*">
   <xsl:element name="{name(.)}" namespace="http://www.xhtml">
   <xsl:apply-templates/>
   </xsl:element>
</xsl:template>

This is all completely doable within standard XSLT 1.0. I just tested 
it with SAXON 6.4.3 and it worked.
-- 

+-----------------------+------------------------+-------------------+
| 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 11:43:58 GMT

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