xslt - FORX0003: The regular expression in tokenize() must not be one that matches a zero-length string -


hi working "," , other delimiters it's not working pipe(|) symbol it's giving forx0003: regular expression in tokenize() must not 1 matches zero-length string

<xsl:template match="@*|node()">     <xsl:copy>         <xsl:apply-templates select="@*|node()"/>     </xsl:copy> </xsl:template>  <xsl:template match="text/text()" name="tokenize">     <xsl:param name="separator" select="'|'"/>     <xsl:for-each select="tokenize(.,$separator)">         <item>             <xsl:value-of select="normalize-space(.)"/>         </item>     </xsl:for-each> </xsl:template> 

you need replace <xsl:param name="separator" select="'|'"/> <xsl:param name="separator" select="'\|'"/> if want tokenize '|' character. have sample xslt:

<?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform">  <xsl:param name="text">navin | rawat</xsl:param> <xsl:param name="separator" select="'\|'"/>    <xsl:template match="/">   <xsl:for-each select="tokenize($text,$separator)">     <item>       <xsl:value-of select="normalize-space(.)"/>     </item>   </xsl:for-each>   </xsl:template>  </xsl:stylesheet> 

output:

<item>navin</item><item>rawat</item> 

Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -