xsl-list
[Top] [All Lists]

Re: [xsl] tokenize

2016-10-12 04:09:19
On 12.10.2016 10:55, Joga Singh Rawat jrawat(_at_)aptaracorp(_dot_)com 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.
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--

<Prev in Thread] Current Thread [Next in Thread>
  • [xsl] tokenize, Joga Singh Rawat jrawat(_at_)aptaracorp(_dot_)com
    • Re: [xsl] tokenize, Martin Honnen martin(_dot_)honnen(_at_)gmx(_dot_)de <=
    • Re: [xsl] tokenize, Michael Kay mike(_at_)saxonica(_dot_)com