This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: upper case


John,

At 09:01 AM 8/21/01, you wrote:
><xsl:value-of
>select="translate($string,'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRST
>UVWXYZ')"/>
>
>is this the only way to make a string upper case?

No, but it's the canonical way.

>  is it not very
>inefficient?

Inefficient how? With respect to the implementation, that depends on the 
processor. With respect to the notation, it's inefficient in comparison to 
Perl, but efficient in comparison to (say) assembler code. XSLT/XPath 
syntax is not optimized for string handling.

Experienced XSLTers will commonly declare variables and do something like

<xsl:value-of select="translate($string, $lowercase, $uppercase)"/>

to alleviate a legibility/maintenance burden.

>my xml needs to support other languages, do i need to worry about letters
>with accents? do they have uppercase versions too?

Generally, yes. There was a thread on this stuff just recently: see 
http://www.biglist.com/lists/xsl-list/archives/200108/msg00561.html. 
Internationalization/localization issues are complex and not to be 
comprehended in a short post or even a long one.

Cheers,
Wendell



======================================================================
Wendell Piez                            mailto:wapiez@mulberrytech.com
Mulberry Technologies, Inc.                http://www.mulberrytech.com
17 West Jefferson Street                    Direct Phone: 301/315-9635
Suite 207                                          Phone: 301/315-9631
Rockville, MD  20850                                 Fax: 301/315-8285
----------------------------------------------------------------------
   Mulberry Technologies: A Consultancy Specializing in SGML and XML
======================================================================


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]