xsl-list
[Top] [All Lists]

RE: xslt 2.0 xsl:copy copy-namespaces

2005-06-12 05:02:17
Like exclude-result-prefixes, copy-namespaces="no" only affects the copying
of unused namespaces. Namespaces that are used in element and attribute
names will always be copied (technically, they aren't copied to the result
tree, but they are added to the result tree by the namespace fixup process).
You can't use xsl:copy or xsl:copy-of to change the name of an element, it
will always have the same local-name and namespace-uri as the original.

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

-----Original Message-----
From: Dave Pawson [mailto:davep(_at_)dpawson(_dot_)co(_dot_)uk] 
Sent: 12 June 2005 10:45
To: Xsl List
Subject: [xsl] xslt 2.0 xsl:copy copy-namespaces

Given input
xmlns:x="http://www.w3.org/1999/xhtml";
  <content>
    <x:div>
      <x:h3>Content head </x:h3>
      <x:p>Content p </x:p>
    </x:div>
  </content>

ssheet

 <xsl:template match="a:content">
   <xsl:apply-templates mode="content"/>
 </xsl:template>

 <xsl:template match="*" mode="content">
    <xsl:copy copy-namespaces="no">
      <xsl:copy-of select="@*"/>
      <xsl:apply-templates mode="content"/>
    </xsl:copy>
</xsl:template>


I'm getting output of


  <x:div xmlns:x="http://www.w3.org/1999/xhtml";>
            
            <x:h3>Content head </x:h3>
            
            <x:p>Content p </x:p>
            
         </x:div>


Shouldn't the namespace be removed?

Saxon 8.4. in use.
Or am I misinterpreting page 244 of Mikes book?


(Oh I do miss the header on the pages.
Trying to find an element now is horrible compared
to the 1.0 book)





-- 
Regards, 

Dave Pawson
XSLT + Docbook FAQ
http://www.dpawson.co.uk


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--





--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>