|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Interesting issue
Hello Nischal,
this is really an extreme demand. I see only this string: <data>SudhakarJalli030719751809Bigbenddrmilpitasca95035Rajeevkasarabada032719751788lowerbenddrivesanjoseca94523</data> Where do you know from (or where should the XSLT processor or JavaScript know from), where to divide the strings in substrings? There seems to be no delimiter and no fixed number of characters. In every case the logic you implemented in JS can be implemented in XSLT with a recursive template: <xsl:template match="/Customers">
<Customers>
<xsl:call-template name="customer">
<xsl:with-param name="data" select="data"/>
</xsl:call-template>
</Customers>
</xsl:template><xsl:template name="customer">
<xsl:param name="data" select="''"/>
<xsl:if test="string(data)">
<Customer>
<FirstName>
<xsl:value-of select="substring($data, 1, 15)"/>
</FirstName>
<LastName>
<xsl:value-of select="substring($data, 16, 1)"/>
</LastName>
<Street>
<xsl:value-of select="substring($data, 17, 1)"/>
</Street>
<City>
<xsl:value-of select="substring($data, 18, 1)"/>
</City>
...
and so on
...
</Customer>
<xsl:call-template name="customer">
<xsl:with-param name="data" select="substring($data, 20)"/>
</xsl:call-template>
</xsl:if>
</xsl:template>But as I said there is no logic for the string length. Where do you want to get it from? Regards, Joerg Nischal Muthana wrote: Hi All XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








