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

Replace an attribute

Subject: Replace an attribute
From: <seantiley@xxxxxxxxxxx>
Date: Thu, 3 Jan 2008 21:49:37 -0500
 Replace an attribute
Hi there,
I am new to xslt but I have an xml file in the following format
<root>
   <file name=3D"c:\blah\blah\class.java">
       <error line=3D"1" message=3D"Parameter status should be final"/>
   </file>
</root>

I would like to be able to replace the name attribute of the file =
element in the original file and leave the rest of the file intact, then =
pass the results to a different stylesheet.

The first step is simply replacing the attribute

I had a look at the replace function and tried something like this
<xsl:value-of select=3D'replace(@name,"c:\blah\blah\*","files")'/>

Unfortunately that seemed to have no effect at all.

I must be missing something painfully obvious

Any advice or suggestions are welcomed, perhaps another function should =
be used but replace sure seems right

Thanks
Sean

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

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

Buy Stylus Studio Now

Cast Your Vote

We need your help – Vote for DataDirect XML Products!

  • Best SOA or XML site

Winners and finalists announced at SOA World Conference in November.

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-2007 All Rights Reserved.