xml editor

Supported platforms

Compatible with Windows7 & Mac OS X Snow Leopard

Ready for data server software
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] and namespaces


Subject: Re: [xsl] <xsl:copy> and namespaces
From: David Carlisle <davidc@xxxxxxxxx>
Date: Mon, 15 Apr 2002 15:37:13 +0100

> 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



Current Thread
XML Editor | XML Author | WYSIWYG Editors | Schema Editor | XSD Documentation | XSL/XSLT Editor | XQuery | XML Databases | SVN Client
© 2002-2011 SyncRO Soft Ltd. All rights reserved. | Sitemap | Privacy Policy | This website was created & generated with <oXygen/>®XML Editor