[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: case and strings 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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|