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

Transforming a node in XSL multiple times

Subject: Transforming a node in XSL multiple times
From: "Spencer" <spencer@xxxxxxxxxxxx>
Date: Tue, 29 Oct 2002 09:21:21 +0200
xsl multiple
 Hi!
 
 We have a tag like this <img src="hello.bmp"/> and we want to perform
 multiple transformations on it such as adding alt and width
 attributes.  This can be done in one template quite easily.
 
However, the problem arises if we need to change this tag again but
 through a different Xpath.  For example, we do a template match on img
 and add alt and width attributes.  Then we do a template match on the
 div and because it has a center alignment, we now want to add the
 height attribute to the preceeding image using the xpath
 preceding::img
 
 <img src="hello.bmp"/>
 <div align="center"/>
 
 This is a completely arbitary example, there are many different cases
 when we need to do similiar transformations to the same tag but from
 more than one template and/or a different XPath that points to the
 same tag.
 
 In the template we use xsl:copy to output the tag and its changes. 
 This prints the tag to the result tree, but we can no longer change it
 in a different template.  If we do (using another xsl:copy) the img is
 printed out again with different attributes.
 
 How can we change this tag multiple times from multiple templates but
 have it only printed out once with all the changes to it?
 
 Thank you in advance for your help



 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.