[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Using copy to change a node, whilst retaining the

Subject: Re: Using copy to change a node, whilst retaining the attributes
From: David Carlisle <davidc@xxxxxxxxx>
Date: Tue, 5 Aug 2003 09:47:47 +0100
Re:  Using copy to change a node

> Tried the below but this does not copy across the attributes. T

that's because you removed   the <xsl:copy-of select="@*"/> line
that were there before. xsl:copy just generates an element node
with the name of the current element you need to copy all attributes and
children if you need them copied.

So you could just add them but...

<xsl:template match="player/dates/yes">
<xsl:copy>
<xsl:choose>
 <xsl:when test="ancestor::player/@pword=$pmkey">

there's not really a lot of point in going down and then coming back
with ancester to test, you may as well test on the way down..

You have two templates like this:
<xsl:template match="player/dates/yes/@ID">
but nowhere are you applying templates to attribute nodes so these
will never activate. You don't want to apply templates to attributes
anyway, you want to copy them as above.


David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star Internet. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

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


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.