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

Re: Converting a string to Uppercase or Lowercase with

Subject: Re: Converting a string to Uppercase or Lowercase without using translate() ?
From: "Andrew Welch" <andrew.j.welch@xxxxxxxxx>
Date: Tue, 27 Nov 2007 10:32:18 +0000
Re:  Converting a string to Uppercase or Lowercase with
On 26/11/2007, G. Ken Holman <gkholman@xxxxxxxxxxxxxxxxxxxx> wrote:
> If by "nicer" you'll accept "more compact", this is what I direct my
> students to include at the top of their stylesheets:
>
> <!DOCTYPE xsl:stylesheet [
>    <!ENTITY lower 'abcdefghijklmnopqrstuvwxyz'>
>    <!ENTITY upper 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'>
> ]>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>                  version="1.0">
>
>
> Then, in your stylesheet you would have:
>
> <xsl:variable name="pClubCaps"
>                select="translate($pClub,'&lower;','&upper;')"/>
>
> But as for functionality, translate() is all we have to work with in XSLT 1.0.

Hi Ken,

Out of interest - why in this case would you prefer using entities
over variables?  My advice would be to avoid entities, I don't see any
benefit here (or in most cases, so I'm approaching this from an
already negative angle :) ....  especially for people new to XSLT.

thanks
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.