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

Re: case and strings conversion

Subject: Re: case and strings conversion
From: JBryant@xxxxxxxxx
Date: Mon, 14 Feb 2005 11:43:13 -0600
surname case conversion
As written, the translate function is working on the value of a variable: 
$string. So you would need a variable that gets the right string, as 
follows:

<xsl:variable name="string" select="jim/@name"/>

Also, you XML is malformed: It is missing a quotation mark before JaMeS 
and needs / before the closing > of the jim element.

I'm guessing (wildly) that what you really want to do is perform some 
action based on the value of a string, regardless of the case of the 
string. For that, you might find something like the following to be more 
useful:

<xsl:template match="jim[upper-case(@name)='JAMES']">
  <!-- Processing based on the match -->
</xsl:template>

Jay Bryant
Bryant Communication Services
(presently consulting at Synergistic Solution Technologies)




dan sherman <h8_bsod@xxxxxxxxx> 
02/14/2005 11:27 AM
Please respond to
xsl-list@xxxxxxxxxxxxxxxxxxxxxx


To
xsl-list@xxxxxxxxxxxxxxxxxxxxxx
cc

Subject
 case and strings conversion






I am having trouble understanding strings and
converting of cases. If I want to match something
exaclty in the xsl the case must match exactly. I have
read the prevois posts on changing the case to match
but I am not getting it. How do I convert james to all
lower or all caps to test in xsl. I have the code and
below, but can not figure it out. Thanks.

<xsl:value-of select="translate($string,
'abcdefghijklmnopqrstuvwxyz',
'ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/>


<xml>
     <jim name=JaMeS">
</xml>


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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.