This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: <xsl:copy> and namespaces



> the copy failes

It's not the copy that fails it's the match, changing teh namespace
changes the name of the element so you have to change the match
expression to the new name. Xpaths in XSLT1 never use the default
namespace decalartion so you have to bind that namespace to a prefix.

(this is a faq)

don't do this:

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
xmlns="urn:my-ns"

do this

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
xmlns:xxxxxxx="urn:my-ns"

then you can do

<xsl:template match="xxxxxxx:record">
  <xsl:copy>
    <xsl:apply-templates select="xxxxxxx:field"/>

David

_____________________________________________________________________
This message has been checked for all known viruses by Star Internet
delivered through the MessageLabs Virus Scanning Service. For further
information visit http://www.star.net.uk/stats.asp or alternatively call
Star Internet for details on the Virus Scanning Service.

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]