RE: [xsl] xmlns print and enumerate

Subject: RE: [xsl] xmlns print and enumerate
From: "Michael Kay" <mike@xxxxxxxxxxxx>
Date: Wed, 8 Mar 2006 20:45:54 -0000
> I have a couple of questions for XSLT 1.0:
> 
> Given the document
> 
> <a/>
> 
> howe do I transform it to:
> 
> <b xmlns:h='http://foo'/>

<xsl:template match="/">
  <b xmlns:h='http://foo'/>
</xsl:template>  

> and given 
> 
> <a xmlns:h='http://foo'/> 
> 
> how do I transform it to:
> 
> <b>
>  <ns prefix='h' uri='http://foo'/>
> </b>
> 

<xsl:template match="a">
  <b>
    <xsl:for-each select="namespace::*">
      <ns prefix="{name()}" uri="{.}"/>
    </
  </
</

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

Current Thread