Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>In XSLT 1.0 if you don't want to write recursive templates yourself, you can use the <a href="http://fxsl.cvs.sourceforge.net/viewvc/fxsl/fxsl-xslt2/f/transform-and-sum.xsl?revision=1.1&amp;view=markup" rel="nofollow"><code>transform-and-sum</code></a> template from <a href="http://fxsl.sf.net" rel="nofollow">FXSL</a></strong>.</p> <p>See how to use it <strong><a href="http://www.biglist.com/lists/xsl-list/archives/200111/msg00835.html" rel="nofollow">here</a></strong>. </p> <hr> <p><strong>Here is the full transformation</strong>:</p> <pre><code>&lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:f="http://fxsl.sf.net/" xmlns:func-transform="f:func-transform" exclude-result-prefixes="xsl f func-transform" &gt; &lt;xsl:import href="transform-and-sum.xsl"/&gt; &lt;!-- to be applied on testTransform-and-sum.xml --&gt; &lt;xsl:output method="text"/&gt; &lt;func-transform:func-transform/&gt; &lt;xsl:template match="/"&gt; &lt;xsl:call-template name="transform-and-sum"&gt; &lt;xsl:with-param name="pFuncTransform" select="document('')/*/func-transform:*[1]"/&gt; &lt;xsl:with-param name="pList" select="/*/*/*"/&gt; &lt;/xsl:call-template&gt; &lt;/xsl:template&gt; &lt;xsl:template match="func-transform:*" mode="f:FXSL"&gt; &lt;xsl:param name="arg1" select="0"/&gt; &lt;xsl:value-of select="number(substring($arg1, 7,2))"/&gt; &lt;/xsl:template&gt; &lt;/xsl:stylesheet&gt; </code></pre> <p><strong>when applied on the provided XML document</strong>:</p> <pre><code>&lt;document&gt; &lt;line id="0"&gt; &lt;field id="0"&gt;&lt;![CDATA[AAAddd17aaass]]&gt;&lt;/field&gt; &lt;/line&gt; &lt;line id="1"&gt; &lt;field id="0"&gt;&lt;![CDATA[DDDaaa33sssaa]]&gt;&lt;/field&gt; &lt;/line&gt; &lt;/document&gt; </code></pre> <p><strong>the wanted, correct result is produced</strong>:</p> <pre><code>50 </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload