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

Re: replace -x to -X

Subject: Re: replace -x to -X
From: Renate <renaate@xxxxxxxxx>
Date: Mon, 10 Jul 2006 19:27:51 +0300
renate welch
How can I do this with translate and substring?

--- XSL beginner

On 7/10/06, andrew welch <andrew.j.welch@xxxxxxxxx> wrote:
On 7/10/06, Renate <renaate@xxxxxxxxx> wrote:
> I have a string $tmp_string.
>
> for ex., JIMMY-DIMMy
>
> And I need to change the following:
> first letter is in uppercase
> other letters are in lowercase
> first letters after "-" sign also is in uppercase
>
> the result will be:
> Jimmy-Dimmy
>
>
> I know how to make Jimmy-dimmy, but how to make Jimmy-Dimmy...???

If you are transforming to HTML then you might want to use CSS:

text-transform: capitalize

This will do what you're after.  If you want to do it in XSLT then I
you'll have to use a recursive solution in 1.0 or tokenize in 2.0 (or
1.0 + extensions) with translate and substring.

cheers
andrew

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.