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

RE: Reverse Tokens Template

Subject: RE: Reverse Tokens Template
From: David Neary <David@xxxxxxxxx>
Date: Thu, 15 May 2003 17:05:05 +0200
xslt reverse

De : Greene, Stephen [mailto:Stephen.Greene@xxxxxx]
> I have been trying to modify (un-sucessfully) Dimitre 
> Novatchev's template
> to reverse the order of "words" in a string (words being character
> substrings seperated by a space character). Such that the 
> string "hello
> world" would become "world hello".
> I was wondering if anyone would be able to offer any hints on how to
> accomplish this.

There's a trick to do this which is independent of word length.

First, reverse the string

This is a string -> gnirts a si sihT

Then reverse each word in the string

gnirts a si sihT -> string a is This

To do this with templates... umm, I'm afraid I don't know. I don't think I'd
try.

Cheers,
Dave.

 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.