Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 30th, 2005, 04:03 PM
Registered User
 
Join Date: Nov 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Using the tranlate() function

Hi,
I am quite new to XSLT and new to forum!

I would like to use the translate() function to change every occurance of the word 'in' to the word 'out' in every element tag and attribute.

The source document is irrelavent, as I'd like it work with any source document that is given.
I'm sure this is quite an easy task, but I am at a loss!

Any help is greatly appreciated.

Thanks,
Dom.
 
Old November 30th, 2005, 05:09 PM
Registered User
 
Join Date: Nov 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

OK, I realise now that you cant do this, so all I'd like to do is replace every occurance of the letter 'i' with 'o' in every attribute and tag of an xml document.

If anyone could point me in the direction of how to tackle this, that would be great.

Thanks,
Dom.

 
Old November 30th, 2005, 05:17 PM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

That's not what the translate() function does, you'll need to find a different way.

Use the replace() function in XSLT 2.0, or look up "replace" in Dave Pawson's FAQ at www.dpawson.co.uk.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference





Similar Threads
Thread Thread Starter Forum Replies Last Post
function keyvanjan ASP.NET 2.0 Professional 1 September 19th, 2007 10:22 AM
send variable in function to another function schoolBoy Javascript How-To 6 March 3rd, 2007 09:16 AM
How to call javascript function from VB function vinod_yadav1919 VB How-To 0 February 13th, 2006 06:03 AM
need help for function mohiddin52 Access 2 June 8th, 2005 01:47 PM
retreive function/Line from macro or function? MikoMax J2EE 0 April 1st, 2004 04:42 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.