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

Re: Need help with XSLT tokenize

Subject: Re: Need help with XSLT tokenize
From: "Prady Prady prady.chin@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 12 Aug 2020 10:42:15 -0000
Re:  Need help with XSLT tokenize
Thank you,  Mukul Gandhi.

On Tue, 11 Aug 2020 at 23:30, Mukul Gandhi gandhi.mukul@xxxxxxxxx <
xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:

> On Tue, Aug 11, 2020 at 5:59 PM Leo Studer leo.studer@xxxxxxxxxxx <
> xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:
>
>> Try something like
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>>     xmlns:xs="http://www.w3.org/2001/XMLSchema"
>>     exclude-result-prefixes="xs"
>>     version="2.0">
>>
>>     <xsl:template match="*Payments*">
>>         <Orders><xsl:apply-templates/></Orders>
>>     </xsl:template>
>>     <xsl:template match="*Payment*">
>>         <xsl:apply-templates/>
>>     </xsl:template>
>>     <xsl:template match="*invoiceDetails*">
>>         <xsl:for-each select="*tokenize*(., ';')[*position*() lt *last*
>> ()]">
>>             <xsl:variable name="data" select="."/>
>>             <Order>
>>                 <OrderNumber><xsl:value-of select="*substring-before*(
>> *$data*,'#')"/></OrderNumber>
>>                 <OrderAmount><xsl:value-of select="*substring-after*(
>> *$data*,'#')"/></OrderAmount>
>>             </Order>
>>         </xsl:for-each>
>>     </xsl:template>
>>
>> </xsl:stylesheet>
>>
>
> I was wanting to write a solution, for this usecase. But above solution
> made me feel that, its elegant and correct (based on visual inspection of
> the code).
>
> But it seems that, Dimitre has taken the solution to this usecase to new
> level.
>
>
>
> --
> Regards,
> Mukul Gandhi
> XSL-List info and archive <http://www.mulberrytech.com/xsl/xsl-list>
> EasyUnsubscribe <http://lists.mulberrytech.com/unsub/xsl-list/3397216> (by
> email <>)

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.