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

Split with delimiter and remove duplicate using XSL 1.

Subject: Split with delimiter and remove duplicate using XSL 1.0
From: "ollie de guzman" <deguzman.ollie@xxxxxxxxx>
Date: Fri, 4 Jul 2008 15:19:10 +0800
 Split with delimiter and remove duplicate using XSL 1.
Hi all!

I am new to XSL programming and I was tasked to solve the problem I
stated on my subject.
As i was browsing the mailing list, i chanced upon this reply

Martin Wrote: I would first tokenize, then use xsl:for-each-group to
remove duplicates:

Perfect. I am going through the tutorials to understand
<xsl:for-each-group> and it use. Still needs to look into the correct
usage of current-group() and current-group-key(), group-by ,
group-adjacent etc. <xsl:copy-of select="current-group()[1]"/>

Time to get seriously involve myself in exploring 2.0. :-)

Thanks again Martin.

Pankaj

I know that this problem can be solved using functions in XSL 2.0 like
tokenize, the use of regular expressions and etc.. but
my question is, can it be solved using purely XSL 1.0 functions?
(without the use of tokenize and regex)

Example.

If i have this tag:

<sample>
...
...
<text>[1]Sample Text 1[2]Sample Text 1[3]Sample Text 2</text>

...
...
</sample>

How can i get this output? The text would be parsed using [] as the
delimiter then remove duplicate values (Sample Text 1)

<out>Sample Text 1</out>
<out>Sample Text 2</out>


Any suggestions?

Thanks a lot in advance.

Ollie de Guzman
Philippines

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.