[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Order of accumulator rules

Subject: Re: Order of accumulator rules
From: "David Maus lists@xxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 27 Jul 2020 18:50:18 -0000
Re:  Order of accumulator rules
Thanks!

Best,
  -- David
On Mon, 27 Jul 2020 20:00:35 +0200,
Michael Kay mike@xxxxxxxxxxxx wrote:
> 
> [1  <text/plain; us-ascii (quoted-printable)>]
> [2  <text/html; us-ascii (quoted-printable)>]
> Bug logged:
> 
> https://saxonica.plan.io/issues/4657
> 
> Michael Kay
> Saxonica
> 
>  On 27 Jul 2020, at 18:11, Michael Kay mike@xxxxxxxxxxxx <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:
> 
>  Added as test case accumulator-081 to XSLT3 test suite.
> 
>  Michael Kay
>  Saxonica
> 
>  On 27 Jul 2020, at 17:33, David Maus lists@xxxxxxxxxx <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:
> 
>  Hello everone,
> 
>  I started to play with XSLT 3 accumulators and am not sure I
>  understand the specifications correctly with regards to the order of
>  accumulator rules.
> 
>  Take the following example:
> 
>  <xsl:transform version="3.0"
>                xmlns:xs="http://www.w3.org/2001/XMLSchema"
>                xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> 
>   <xsl:output method="text"/>
> 
>   <xsl:mode on-no-match="shallow-skip" use-accumulators="#all"/>
> 
>   <xsl:accumulator name="accumulator" as="xs:integer" initial-value="0">
>     <xsl:accumulator-rule match="element">
>       <xsl:sequence select="1"/>
>     </xsl:accumulator-rule>
>     <xsl:accumulator-rule match="element">
>       <xsl:sequence select="2"/>
>     </xsl:accumulator-rule>
>   </xsl:accumulator>
> 
>   <xsl:template match="/">
>     <xsl:apply-templates/>
>     <xsl:sequence select="accumulator-after('accumulator')"/>
>   </xsl:template>
>  </xsl:transform>
> 
>  And apply it to the following document:
> 
>  <element/>
> 
>  From my reading of the specs I would expect value of the accumulator
>  to be 2 because both rules match the element node and the rule
>  selecting 2 is last in document order. But this stylesheet returns 1
>  when I run it with Saxon EE 10.1.
> 
>  This seems to be a bug in Saxon, doesn't it?
> 
>  Best,
>   -- David
> 
>  -- 
>  David Maus M.A.
> 
>  Www: http://dmaus.name
>  Twitter: @_dmaus
> 
>  XSL-List info and archive
>  EasyUnsubscribe (by email)
> 
> XSL-List info and archive 
> EasyUnsubscribe (by email) 

-- 
David Maus M.A.

Www: http://dmaus.name
Twitter: @_dmaus

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.