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

RE: Force the case of a set of strings

Subject: RE: Force the case of a set of strings
From: "Kerry, Richard" <richard.kerry@xxxxxxxx>
Date: Tue, 30 Oct 2012 12:13:57 +0000
RE:  Force the case of a set of strings
> >I have a sequence of strings which are all 'ok' or 'fail' where I
> >want to force the case of all of them.
>
> Actually, it looks like you have a sequence of nodes in
> $states, not strings.

Ah yes.  Actually I did know that (no really).  I just didn't state
It properly.

> >Can anyone suggest how I might process my sequence to return a
> >sequence but have each entry passed through lower-case.
>
> $states/lower-case(normalize-space(column[7]))

Thank you, done that.  Seems to be working.

> I remind my students in class that the "/" in "$nodes/expr" is an
> abbreviation for:
>
>    for $n in $nodes return expr($n)
>
> ... which is exactly what you did in setting your first variable.  I
> just took it one step further.

I realized I could get the column data via normalize-space.  I just didn't
spot that I could just add the lower-case there.


> >I thought maybe I could pass it as a parameter to a moded
> >apply-templates, but then I get warned that select needs a node, not
> >a string, as its @select attribute.
>
> That shouldn't be necessary if the input is as simple as you imply.

It wasn't, and it is.

> >Subsequently I do distinct-values on it and the result of that I
> >want only to contain 'ok' or 'fail', with no case variations
> remaining.
>
> The sequence above would be satisfactory input to distinct-values().

It was.

>
> I hope this helps.

Very much so.
XSLT is very much about how to look at what you've got.
And especially about sequences.

> . . . . . . . . . Ken

Richard.

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.