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

On-the-fly case-conversion w. translate()

Subject: On-the-fly case-conversion w. translate()
From: Shivani Goel <goelshivani@xxxxxxxxx>
Date: Wed, 6 Apr 2005 14:07:51 -0700 (PDT)
fly case
I've been through this list (and also googled my
query), but am wits end as why my code doesnt work:

This is a fragment from my XML file:

<Program name="project oregon">
...
..
</Program>
<Program name="project oregon">
..
...
.......
</Program>
<Program name="Project Oregon">
.......
........
.......
</Program>
<Program name="Spring Beach Cleanup">
..............
.........
</Program>
<Program name="Spring Beach Cleanup">
...
</Program>

I want to display the value of attr 'name', in an HTML
<select> element (aka drop down list), while
eliminating duplicates, for which, I do this:

<select class="formDropDown1" name="program"
id="program">

<xsl:if  test= "@name [not (self::node() =
following::Program/@name)]">

<option>

    <xsl:attribute name="value"><xsl:value-of
select="@name"/></xsl:attribute>
    <xsl:value-of select="@name" />
						</option>
						    </xsl:if>

The above works flawlesslessly to eliminate duplicates
(though from what I've read, using 'following' axis
may lead to pefomance issues with very large XML
files...).

However, *and this is my reason for posting to the
list*, I want to have "project oregon" and "Project
Oregon" display only once! I tried the following to
translate the respective nodes to identical (upper)
case, as follows:

<xsl:if test="@name[not(translate (self::node(),
abcdefghijklmnopqrstuvwxyz,
ABCDEFGHIJKLMNOPQRSTUVWXYZ) = translate
(following::Program/@name, abcdefghijklmnopqrstuvwxyz,
ABCDEFGHIJKLMNOPQRSTUVWXYZ))]" >

This does NOT work! Duplicates are eliminated,
however, "project oregon" & "Project Oregon " are
treated as separate /unique strings. What am I doing
wrong?

Any suggestions will be gratefully welcome.

Shivani.





		
__________________________________ 
Do you Yahoo!? 
Yahoo! Personals - Better first dates. More second dates. 
http://personals.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.