Re: [xsl] tokenize

Subject: Re: [xsl] tokenize
From: "Martin Honnen martin.honnen@xxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 12 Oct 2016 09:09:14 -0000
On 12.10.2016 10:55, Joga Singh Rawat jrawat@xxxxxxxxxxxxxx wrote:

I am not getting the Expected Output by following inputs. Any idea? Thanks
in advance.

Xslt
<xsl:template match="w:p">
   <xsl:if test="w:pPr/w:pStyle/@w:val='Authors0'">
    <aug>
     <xsl:apply-templates select="*" mode="make-tokens"/>
   </aug>
</xsl:if>
</xsl:template>
<xsl:template match="*" mode="make-tokens">
  <xsl:for-each select="tokenize(.,', ')">
   <xsl:if test=".!=''">
    <au><xsl:copy-of select="."/></au>
   </xsl:if>
  </xsl:for-each>
 </xsl:template>
 <xsl:template match="w:r[w:rPr/w:vertAlign/@w:val='superscript']"
mode="make-tokens">
  </xsl:variable>

Given that </xsl:variable> there without any opening xsl:variable I doubt you can run that code at all.



If an element has child elements you want to transform you can't use tokenize on the string contents of the element without losing the child element. So you will have to use tokenize or analyze-string on text nodes, not on element nodes.


Current Thread