Subject: Re: [xsl] Re: Need help with tokenize functionality in XSLT 1.0 From: "Christophe Marchand cmarchand@xxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> Date: Thu, 20 Aug 2020 08:37:58 -0000 |
Wouahou ! car, cdr ! I haven't seen this since... I can't remember ! Nice to see old things are still usefull ! Best, Christophe Le 19/08/2020 C 18:35, David Carlisle d.p.carlisle@xxxxxxxxx a C)critB : > > So last century we's have done > > <xsl:stylesheet version="1.0" > xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> > <xsl:output indent="yes"/> > > <xsl:template match="Payments"> > B <Orders> > B <xsl:apply-templates/> > B </Orders> > </xsl:template> > > > <xsl:template match="Payment"> > B <xsl:param name="details" select="invoiceDetails"/> > B <xsl:variable name="car" select="substring-before($details,';')"/> > B <xsl:variable name="cdr" select="substring-after($details,';')"/> > B <Order> > B <OrderNumber><xsl:value-of > select="substring-before($car,'#')"/></OrderNumber> > B <Ammount><xsl:value-of select="substring-after($car,'#')"/></Ammount> > B </Order> > B <xsl:if test="contains($cdr,'#')"> > B <xsl:apply-templates select="."> > B B <xsl:with-param name="details" select="$cdr"/> > B </xsl:apply-templates> > B </xsl:if> > </xsl:template> > > > </xsl:stylesheet> > > > $ saxon9 pay.xml pay.xsl > <?xml version="1.0" encoding="UTF-8"?> > <Orders> > B B <Order> > B B B <OrderNumber>order1</OrderNumber> > B B B <Ammount>amt1</Ammount> > B B </Order> > B B <Order> > B B B <OrderNumber>order2</OrderNumber> > B B B <Ammount>amt2</Ammount> > B B </Order> > </Orders> > > > XSL-List info and archive <http://www.mulberrytech.com/xsl/xsl-list> > EasyUnsubscribe <http://lists.mulberrytech.com/unsub/xsl-list/2837134> > (by email <>)
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Re: Need help with tokeni, David Carlisle d.p.c | Thread | Re: [xsl] Re: Need help with tokeni, Norman Tovey-Walsh n |
Re: [xsl] Re: Need help with tokeni, BR Chrisman brchrism | Date | Re: [xsl] Re: Need help with tokeni, Norman Tovey-Walsh n |
Month |