Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
| Search | Today's Posts | Mark Forums Read
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 28th, 2007, 07:06 AM
Authorized User
 
Join Date: Jan 2006
Location: tel aviv, israel, Israel.
Posts: 59
Thanks: 0
Thanked 0 Times in 0 Posts
Default lower case

hello

I want in xsl to translate a return to be in lower case
where $tech_id could be lower case, or upper case. is it possible?
is there a function in xsl that does it?

<xsl:attribute name="key">
    <xsl:value-of select= "concat('this-', $tech_id, '-entity')"/>
</xsl:attribute>

 
Old February 28th, 2007, 07:17 AM
joefawcett's Avatar
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

If you are only using ASCII characters then use the translate function:
Code:
<xsl:variable name="UPPER" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'"/>
<xsl:variable name="lower" select="'abcdefghijklmnopqrstuvwxyz'"/>
<xsl:attribute name="key">
    <xsl:value-of select= "concat('this-', translate($tech_id, $UPPER, $lower), '-entity')"/>
</xsl:attribute>
--

Joe (Microsoft MVP - XML)
 
Old February 28th, 2007, 07:22 AM
Registered User
 
Join Date: Jan 2007
Location: Reading, , United Kingdom.
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

If you just want to translate the vale of $tech_id to lower case use the translate function:

<xsl:variable name="lcase">abcdefghijklmnopqrstuvwxyz</xsl:variable>
<xsl:variable name="ucase">ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:variable>

<xsl:attribute name="key">
    <xsl:value-of select= "concat('this-', translate($tech_id, $ucase, $lcase), '-entity')"/>
</xsl:attribute>

Regards
Bryan
www.3chillies.co.uk

 
Old February 28th, 2007, 07:43 AM
Authorized User
 
Join Date: Jan 2006
Location: tel aviv, israel, Israel.
Posts: 59
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanks





Similar Threads
Thread Thread Starter Forum Replies Last Post
how to make lower case in dataformatstring hardik Classic ASP Databases 1 February 14th, 2006 05:45 AM
check for lower case (LCase)? crmpicco Excel VBA 2 May 12th, 2005 03:42 PM
search string either Upper case or lower case rylemer Beginning VB 6 3 March 24th, 2004 04:23 PM
Checking for upper,lower case, number and symbol dumbdumb SQL Server 2000 1 March 18th, 2004 03:51 AM
Check Case in a Case-Insensitive DB nbryson SQL Language 1 January 23rd, 2004 07:36 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.