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

Changing the Value of Elements Using XSL

Subject: Changing the Value of Elements Using XSL
From: "Pilarski,James" <James.Pilarski@xxxxxxxxx>
Date: Mon, 3 Mar 2003 12:00:07 -0600
value of elements
> I was wondering if somebody could answer a question for me.  I have the following XML file: 
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <FileInformation>
> 	<General CreationDate="2003-01-01">
> 		<AccessedDate ModifiedDate="2003-02-14">2003-03-17</AccessedDate>
> 		<System>TRS80</System>
> 	</General>
> </FileInformation>
> 
> Currently, I am using XSL to display the information in a table in HTML in a web browser.  Until now the system that generates the XML was updating everything perfectly.  This will be fixed in the future but for now I was wondering if there was any way for me to change the text in the <AccessedDate> element without effecting any of the other elements or attributes.  Unfortunately, the current system's structure does not allow me to transform the XML, save, and redisplay it in the browser.  What I need to do is get the new Accessed Date from another node in the XML (I have assigned this to a variable already, $NewDate) and set the <AccessedDate> element equal to the $NewDate variable.  So if the new Accessed Date in the date variable is 2003-12-25, I would want the XML to look like this:
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <FileInformation>
> 	<General CreationDate="2003-01-01">
> 		<AccessedDate ModifiedDate="2003-02-14">2003-12-25</AccessedDate>
> 		<System>TRS80</System>
> 	</General>
> </FileInformation>
> 
> I am pretty new to XSL but I do not think this is possible without an outright transformation.
> 
> Thanks,
> Jim
> 

 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.