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

Re: processing text nodes one character at a time

Subject: Re: processing text nodes one character at a time
From: "Dimitre Novatchev" <dnovatchev@xxxxxxxxx>
Date: Tue, 26 Sep 2006 18:09:34 -0700
 Re: processing text nodes one character at a time
On 9/26/06, Dimitre Novatchev <dnovatchev@xxxxxxxxx> wrote:
The original poster asked:

 How to output a specific character in front of every character in a
given string?

Part I:
====
This is a problem that is easily solved with FXSL. the solution is
this one-liner:


f:str-map(f:flip(f:concat2(), '|'), string(/*))

Part II ==== Of course, it needs to be put into a stylesheet:


<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"

xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:f="http://fxsl.sf.net/"
xmlns:testmap="testmap"
exclude-result-prefixes="xs f"

 <xsl:import href="../f/func-str-dvc-map.xsl"/>
 <xsl:import href="../f/func-curry.xsl"/>
 <xsl:import href="../f/func-flip.xsl"/>

 <!-- To be applied on text.xml -->
 <xsl:output omit-xml-declaration="yes" indent="yes"/>

 <xsl:template match="/">
   <xsl:sequence select=
    "f:str-map(f:flip(f:concat2(), '|'), string(/*))"
    />
 </xsl:template>


and this woud be the place to put the </xsl:stylesheeet> end-tag when the definition of the various f:concat2() functions were part of FXSL (I'll be uploading them shortly).

And I will send the function definitions in Part III.

The reasons of this splitting of what originally was one reply is that
it never came through, regardless of three attempts -- gmail somehow
desides to use bin64 encoding, which xsl-list rejects. Sorry for the
inconvenience...

--
Cheers,
Dimitre Novatchev
---------------------------------------
Truly great madness cannot be achieved without significant intelligence.
---------------------------------------
To invent, you need a good imagination and a pile of junk
-------------------------------------
You've achieved success in your field when you don't know whether what
you're doing is work or play

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Cast Your Vote

We need your help – Vote for DataDirect XML Products!

  • Best SOA or XML site

Winners and finalists announced at SOA World Conference in November.

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-2007 All Rights Reserved.