RE: [xsl] xmlns print and enumerate

Subject: RE: [xsl] xmlns print and enumerate
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Thu, 9 Mar 2006 19:15:19 -0000
In XSLT 2.0 you use <xsl:namespace name="{@prefix}" select="@uri"/>

In XSLT 1.0 there's a circumlocution something like:

<xsl:variable name="temp">
  <xsl:element name="{@prefix}.dummy" namespace="{@uri}"/>
</xsl:variable>
<ns>
  <xsl:copy-of select="xx:node-set($temp)//namespace::*"/>
</ns>

but even this needs the node-set() extension; I don't think there's a pure
XSLT 1.0 solution. It also relies on an erratum to the original XSLT 1.0
spec concerning copying of namespace nodes.

Michael Kay
http://www.saxonica.com/

 

> -----Original Message-----
> From: Michele Vivoda [mailto:idmichele@xxxxxxxx] 
> Sent: 09 March 2006 19:04
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: RE: [xsl] xmlns print and enumerate
> 
> Thank you very much, exactly what I was looking for,
> I was missing the namespace operator.
> 
> For my mistake, I made a "wrong" question (the number
> 1),
> what I would like to know additionally is, 
> how do I transform the final result of question 2:
> 
> <b>
>  <ns prefix='h' uri='http://foo'/>
> </b>
> 
> "back" to the source:
> 
> <a xmlns:h='http://foo'/> 
> 
> I am dealing with qnames in attribute values...
> (lower case to distinguish them from QNames of node
> names ;-)
> 
> Thanks again,
> Michele Vivoda
> 
> 
> 	
> 
> 	
> 		
> ___________________________________ 
> Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB 
> http://mail.yahoo.it

Current Thread