xsl-list
[Top] [All Lists]

Re: [xsl] replace -x to -X

2006-07-10 09:28:04
How can I do this with translate and substring?

--- XSL beginner

On 7/10/06, andrew welch <andrew(_dot_)j(_dot_)welch(_at_)gmail(_dot_)com> 
wrote:
On 7/10/06, Renate <renaate(_at_)gmail(_dot_)com> 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

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>