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

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

Subject: Re: On-the-fly case-conversion w. translate()
From: David Carlisle <davidc@xxxxxxxxx>
Date: Wed, 6 Apr 2005 22:19:49 +0100
fly case
  <xsl:if  test= "@name [not (self::node() =
  following::Program/@name)]">

self::node() can be written more simply as .

  translate
  (following::Program/@name, abcdefghijklmnopqrstuvwxyz,
  ABCDEFGHIJKLMNOPQRSTUVWXYZ))]"

This has come up already today (and is a faq) lthough I'm not sure what
you'd search for. If you use a node set as an argument to a string
function xslt1 takes the first node in document order in the set and
uses that nodes string value, it ignores any other nodes.

it (might be) a bit more efficient or at least clearer  to use
following-sibling on the element node rather than following from the
attribute node,

test="@name=following-sibling::Program/@name"
tests if this nodes name attribute is equal to any of the following
nodes names.

test="translate(@name,$u,$l)=translate(following-sibling::Program/@name,$u.$l)"
tests if this nodes name attribute is equal to the _immediately
following_ Program nodes name attribute.

In this case you can do

test="following-sibling::Program/@name[translate(.,$u.$l) =translate(current()/@name,$u,$l)]"

David


________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

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.