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

RE: case insensitive attributes

Subject: RE: case insensitive attributes
From: James Eberhardt <JEberhardt@xxxxxxxxxx>
Date: Thu, 5 Apr 2001 12:24:51 -0400
xsl if case insensitive
Since you should want to control your data, then what I would suggest is
translating your user input before putting in the XML.  That way UserId is
ALWAYS the same case.  Just my thought.  Otherwise I don't think you can
test for this in one XPath statement.  What you might try is do an
apply-templates, then within that template test the value of UserId.  Like
this:

<xsl:template match="/">
	<xsl:apply-templates select="//CamUsers" />
</xsl:template>

<xsl:template match="//CamUsers">
	<xsl:if test="translate(@UserId,'admin','ADMIN')='ADMIN'">
		<xsl:value-of select="." />
	</xsl:if>
</xsl:template>

The solution that Jeni was suggesting would check only if UserId was one or
the other.  (I think)



-----Original Message-----
From: Jay Gardner [mailto:jgardner@xxxxxxxxxxxxxxxxxxxxxx]
Sent: Thursday, April 05, 2001 12:09 PM
To: Jeni Tennison
Cc: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: RE:  case insensitive attributes

Thanks Jeni

Actually, the all caps ADMIN was just for testing.

It could come in as Admin ADmin ADmiN or anything 
like that.  It comes from user input to a login form.

I ended up using this and it seems to be working, but
I am not sure how efficient it will be.

root/CamUsers[@UserId = translate(@UserId,'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
'abcdefghijklmnopqrstuvwxyz') = 'Admin']

Regards,

Jay Gardner

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


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.