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

RE: translate

Subject: RE: translate
From: "M. David Peterson" <m.david@xxxxxxxxxx>
Date: Wed, 24 Mar 2004 08:17:34 -0700
xsl translate regex
You also need to remember that translate() is not a regex-styled pattern
matching function but instead a way to match individual characters in
the second position of the function to a string in the first position
and replace them with the character within the third position function
found in the same numerical position of the second position of the
function.  Or in other words translate('cat',
'abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ') would return
'CAT'.  What it seems like you are trying to do (replace each instance
of one entity with the value of another) is a much more complicated
process that requires using a recursive named-template method.  Examples
of this method can be found all over the archives.

Best of luck!

<M:D/>

-----Original Message-----
From: David Carlisle [mailto:davidc@xxxxxxxxx] 
Sent: Wednesday, March 24, 2004 7:35 AM
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re:  translate


> How can I make this work?

translate() takes three strings as arguments you have given a Node set
as the first, which is OK, it will take the string value of that node,
but your second two arguments are just floating characters, so a syntax
error, XPath strings have to be in "" or ''
so you want translate(EPAPER,'&#x002D;','&#x2013;')

David



-- 
http://www.dcarlisle.demon.co.uk/matthew

________________________________________________________________________
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
________________________________________________________________________

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.