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

RE: Tokenising the string using xpath funcitons.

Subject: RE: Tokenising the string using xpath funcitons.
From: "Michael Kay" <mhkay@xxxxxxxxxxxx>
Date: Wed, 26 Sep 2001 12:13:29 +0100
xsl string funcitons
Since you are already using extension functions, I would use an extension
function to parse the string and return it as an XML document. (In the way
that saxon:tokenize() does).

The alternative is a recursive named template: grab the first item in the
string using substring-before(), then call yourself to process the rest of
the string, extracted using subsring-after().

Mike Kay

> -----Original Message-----
> From: owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> [mailto:owner-xsl-list@xxxxxxxxxxxxxxxxxxxxxx]On Behalf Of Avula, Raj
> Sent: 26 September 2001 01:53
> To: 'xsl-list@xxxxxxxxxxxxxxxxxxxxxx'
> Subject:  Tokenising the string using xpath funcitons.
>
>
>
> 	Hi,
> 		I have a string like this
> (ACT=28:99:113:98:99:109:114:114:156:28:) in xsl file.
> I am getting this string from extension function. Number of
> entries in the
> string is not fixed.
> I want to basically parse the string and get all the values.
> To give you the
> exact picture,
> I have a customer, and no. of orders for it. each entry in
> the above string
> is associated with an order.
> I have a template for transforming orders. I have to pass the
> first entry of
> the string
> to the first order, and second entry to the second order and so on.
>
> eg:
> input xml
> <customer>
> 	<order></order>
> 	<order></order>
> 	<order></order>
> 	<order></order>
> </customer>
>
> output should be something like
> <customer>
> 	<order>28</order>
> 	<order>99</order>
> 	<order>113</order>
> 	<order>98</order> ( and so on..)
> </customer>
>
> Can any body help me on how to handle this problem?
>
> Thank You very much,
>
> Raj.
>
> "MMS <firstam.com>" made the following
>  annotations on 09/25/01 17:53:17
> --------------------------------------------------------------
> ----------------
> "THIS E-MAIL MESSAGE AND ANY FILES TRANSMITTED HEREWITH, ARE
> INTENDED SOLELY FOR THE USE OF THE INDIVIDUAL(S) ADDRESSED
> AND MAY CONTAIN CONFIDENTIAL, PROPRIETARY OR PRIVILEGED
> INFORMATION.  IF YOU ARE NOT THE ADDRESSEE INDICATED IN THIS
> MESSAGE (OR RESPONSIBLE FOR DELIVERY OF THIS MESSAGE TO SUCH
> PERSON) YOU MAY NOT REVIEW, USE, DISCLOSE OR DISTRIBUTE THIS
> MESSAGE OR ANY FILES TRANSMITTED HEREWITH.  IF YOU RECEIVE
> THIS MESSAGE IN ERROR, PLEASE CONTACT THE SENDER BY REPLY
> E-MAIL AND DELETE THIS MESSAGE AND ALL COPIES OF IT FROM YOUR SYSTEM."
>
> ==============================================================
> ================
>
>
>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
>


 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.