Incorrect/Different Result for postion() from Saxon 9.6 to 9.7

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Incorrect/Different Result for postion() from Saxon 9.6 to 9.7

Eliot Kimber-2
I have code like this:

<xsl:if test="not(position() = last())">
              <xsl:text>,</xsl:text>
            </xsl:if>

When I run this transform under Saxon 9.6.0.7 (the version of 9.6 I had
lying about) I get the expected result from my data set.

However, when I run with 9.7.0.1 or 9.7.0.5 I appear to get the position
and next for the parent of the context element.

The source XML is:


<define name="mytopic.content">
        <ref name="title"/>
        <optional>
          <ref name="titlealts"/>
        </optional>
        <optional>
          <choice>
            <ref name="abstract"/>
            <ref name="shortdesc"/>
          </choice>
        </optional>
        <optional>
          <ref name="prolog"/>
        </optional>
        <optional>
          <ref name="body"/>
        </optional>
        <optional>
          <ref name="related-links"/>
        </optional>
        <zeroOrMore>
          <ref name="mytopic-info-types"/>
        </zeroOrMore>
      </define>


And my template is matching on <ref> elements, using the position() =
last() check to determine when to omit commas


When I run with 9.6 I get the correct result, and these position() and
last() values:

     [java]  + [DEBUG] element-decls: rng:ref(), name="info-types",
position="1", last="1"
     [java]  + [DEBUG] element-decls: rng:ref(), name="titlealts",
position="1", last="1"
[java]  + [DEBUG] element-decls: rng:ref(), name="abstract", position="1",
last="1"
     [java]  + [DEBUG] element-decls: rng:ref(), name="shortdesc",
position="1", last="1"
     [java]  + [DEBUG] element-decls: rng:ref(), name="prolog",
position="1", last="1"
     [java]  + [DEBUG] element-decls: rng:ref(), name="body",
position="1", last="1"
     [java]  + [DEBUG] element-decls: rng:ref(), name="related-links",
position="1", last="1"
     [java]  + [DEBUG] element-decls: rng:ref(),
name="mytopic-info-types", position="1", last="1"


(Although I notice looking at these results that abstract and shortdesc,
which are siblings, do not report the expected position() or last()
values, so something is not right here.

With 9.7 I get these results:

     [java]  + [DEBUG] element-decls: rng:ref(), name="info-types",
position="2", last="3"
     [java]  + [DEBUG] element-decls: rng:ref(), name="titlealts",
position="2", last="3"
     [java]  + [DEBUG] element-decls: rng:ref(), name="abstract",
position="1", last="1"
     [java]  + [DEBUG] element-decls: rng:ref(), name="shortdesc",
position="1", last="1"
     [java]  + [DEBUG] element-decls: rng:ref(), name="prolog",
position="2", last="3"
     [java]  + [DEBUG] element-decls: rng:ref(), name="body",
position="2", last="3"
     [java]  + [DEBUG] element-decls: rng:ref(), name="related-links",
position="2", last="3"
     [java]  + [DEBUG] element-decls: rng:ref(),
name="mytopic-info-types", position="2", last="3"


For all but abstract and shortdesc, the position() and last() values are
different and also not what was expected.

The transform and source I'm using is available here:

https://github.com/oasis-open/dita-rng-converter/commit/c5dbc3379e0b7b6684e
38fa63439e391fbb34a47

The command line I'm running is:

ant generate-dtd
-DdoctypesDir=test/specializations/org.example/1.3/rng/mytopic
-Doutdir=test/specializations/org.example -DgenerateCatalogs=true
-DgenerateModules=true -Ddebug=false


I think the abstract and shortdesc results are explained by this code:

<xsl:for-each select="rng:*">
      <xsl:if test="not(position()=1)">
        <xsl:text> |&#x0a;</xsl:text>
      </xsl:if>
      <xsl:apply-templates select="." mode="#current" />
    </xsl:for-each>

Which is used for choice groups, which abstract and shortdesc are children
of. In that case, each group has size 1 so the 1/1 result makes sense.


But the other results make no sense that I can see and there is definitely
a difference from 9.6 to 9.7.

It also looks like my code works by accident with 9.6 but definitely fails
with 9.7.

Cheers,

Eliot

----
Eliot Kimber, Owner
Contrext, LLC
http://contrext.com




------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Incorrect/Different Result for postion() from Saxon 9.6 to 9.7

Michael Kay
Thanks for reporting. Please track this one here:

https://saxonica.plan.io/issues/2788

Michael Kay
Saxonica


> On 9 Jun 2016, at 19:16, Eliot Kimber <[hidden email]> wrote:
>
> I have code like this:
>
> <xsl:if test="not(position() = last())">
>              <xsl:text>,</xsl:text>
>            </xsl:if>
>
> When I run this transform under Saxon 9.6.0.7 (the version of 9.6 I had
> lying about) I get the expected result from my data set.
>
> However, when I run with 9.7.0.1 or 9.7.0.5 I appear to get the position
> and next for the parent of the context element.
>
> The source XML is:
>
>
> <define name="mytopic.content">
>        <ref name="title"/>
>        <optional>
>          <ref name="titlealts"/>
>        </optional>
>        <optional>
>          <choice>
>            <ref name="abstract"/>
>            <ref name="shortdesc"/>
>          </choice>
>        </optional>
>        <optional>
>          <ref name="prolog"/>
>        </optional>
>        <optional>
>          <ref name="body"/>
>        </optional>
>        <optional>
>          <ref name="related-links"/>
>        </optional>
>        <zeroOrMore>
>          <ref name="mytopic-info-types"/>
>        </zeroOrMore>
>      </define>
>
>
> And my template is matching on <ref> elements, using the position() =
> last() check to determine when to omit commas
>
>
> When I run with 9.6 I get the correct result, and these position() and
> last() values:
>
>     [java]  + [DEBUG] element-decls: rng:ref(), name="info-types",
> position="1", last="1"
>     [java]  + [DEBUG] element-decls: rng:ref(), name="titlealts",
> position="1", last="1"
> [java]  + [DEBUG] element-decls: rng:ref(), name="abstract", position="1",
> last="1"
>     [java]  + [DEBUG] element-decls: rng:ref(), name="shortdesc",
> position="1", last="1"
>     [java]  + [DEBUG] element-decls: rng:ref(), name="prolog",
> position="1", last="1"
>     [java]  + [DEBUG] element-decls: rng:ref(), name="body",
> position="1", last="1"
>     [java]  + [DEBUG] element-decls: rng:ref(), name="related-links",
> position="1", last="1"
>     [java]  + [DEBUG] element-decls: rng:ref(),
> name="mytopic-info-types", position="1", last="1"
>
>
> (Although I notice looking at these results that abstract and shortdesc,
> which are siblings, do not report the expected position() or last()
> values, so something is not right here.
>
> With 9.7 I get these results:
>
>     [java]  + [DEBUG] element-decls: rng:ref(), name="info-types",
> position="2", last="3"
>     [java]  + [DEBUG] element-decls: rng:ref(), name="titlealts",
> position="2", last="3"
>     [java]  + [DEBUG] element-decls: rng:ref(), name="abstract",
> position="1", last="1"
>     [java]  + [DEBUG] element-decls: rng:ref(), name="shortdesc",
> position="1", last="1"
>     [java]  + [DEBUG] element-decls: rng:ref(), name="prolog",
> position="2", last="3"
>     [java]  + [DEBUG] element-decls: rng:ref(), name="body",
> position="2", last="3"
>     [java]  + [DEBUG] element-decls: rng:ref(), name="related-links",
> position="2", last="3"
>     [java]  + [DEBUG] element-decls: rng:ref(),
> name="mytopic-info-types", position="2", last="3"
>
>
> For all but abstract and shortdesc, the position() and last() values are
> different and also not what was expected.
>
> The transform and source I'm using is available here:
>
> https://github.com/oasis-open/dita-rng-converter/commit/c5dbc3379e0b7b6684e
> 38fa63439e391fbb34a47
>
> The command line I'm running is:
>
> ant generate-dtd
> -DdoctypesDir=test/specializations/org.example/1.3/rng/mytopic
> -Doutdir=test/specializations/org.example -DgenerateCatalogs=true
> -DgenerateModules=true -Ddebug=false
>
>
> I think the abstract and shortdesc results are explained by this code:
>
> <xsl:for-each select="rng:*">
>      <xsl:if test="not(position()=1)">
>        <xsl:text> |&#x0a;</xsl:text>
>      </xsl:if>
>      <xsl:apply-templates select="." mode="#current" />
>    </xsl:for-each>
>
> Which is used for choice groups, which abstract and shortdesc are children
> of. In that case, each group has size 1 so the 1/1 result makes sense.
>
>
> But the other results make no sense that I can see and there is definitely
> a difference from 9.6 to 9.7.
>
> It also looks like my code works by accident with 9.6 but definitely fails
> with 9.7.
>
> Cheers,
>
> Eliot
>
> ----
> Eliot Kimber, Owner
> Contrext, LLC
> http://contrext.com
>
>
>
>
> ------------------------------------------------------------------------------
> What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
> patterns at an interface-level. Reveals which users, apps, and protocols are
> consuming the most bandwidth. Provides multi-vendor support for NetFlow,
> J-Flow, sFlow and other flows. Make informed decisions using capacity
> planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
> _______________________________________________
> saxon-help mailing list archived at http://saxon.markmail.org/
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/saxon-help 



------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Incorrect/Different Result for postion() from Saxon 9.6 to 9.7

Eliot Kimber-2
Glad to help :-)

I rewrote my code to use "count(following-sibling::rng:*) gt 0" and that
of course works around the reported behavior.

Cheers,

E.
----
Eliot Kimber, Owner
Contrext, LLC
http://contrext.com




On 6/9/16, 3:20 PM, "Michael Kay" <[hidden email]> wrote:

>Thanks for reporting. Please track this one here:
>
>https://saxonica.plan.io/issues/2788
>
>Michael Kay
>Saxonica
>
>
>> On 9 Jun 2016, at 19:16, Eliot Kimber <[hidden email]> wrote:
>>
>> I have code like this:
>>
>> <xsl:if test="not(position() = last())">
>>              <xsl:text>,</xsl:text>
>>            </xsl:if>
>>
>> When I run this transform under Saxon 9.6.0.7 (the version of 9.6 I had
>> lying about) I get the expected result from my data set.
>>
>> However, when I run with 9.7.0.1 or 9.7.0.5 I appear to get the position
>> and next for the parent of the context element.
>>
>> The source XML is:
>>
>>
>> <define name="mytopic.content">
>>        <ref name="title"/>
>>        <optional>
>>          <ref name="titlealts"/>
>>        </optional>
>>        <optional>
>>          <choice>
>>            <ref name="abstract"/>
>>            <ref name="shortdesc"/>
>>          </choice>
>>        </optional>
>>        <optional>
>>          <ref name="prolog"/>
>>        </optional>
>>        <optional>
>>          <ref name="body"/>
>>        </optional>
>>        <optional>
>>          <ref name="related-links"/>
>>        </optional>
>>        <zeroOrMore>
>>          <ref name="mytopic-info-types"/>
>>        </zeroOrMore>
>>      </define>
>>
>>
>> And my template is matching on <ref> elements, using the position() =
>> last() check to determine when to omit commas
>>
>>
>> When I run with 9.6 I get the correct result, and these position() and
>> last() values:
>>
>>     [java]  + [DEBUG] element-decls: rng:ref(), name="info-types",
>> position="1", last="1"
>>     [java]  + [DEBUG] element-decls: rng:ref(), name="titlealts",
>> position="1", last="1"
>> [java]  + [DEBUG] element-decls: rng:ref(), name="abstract",
>>position="1",
>> last="1"
>>     [java]  + [DEBUG] element-decls: rng:ref(), name="shortdesc",
>> position="1", last="1"
>>     [java]  + [DEBUG] element-decls: rng:ref(), name="prolog",
>> position="1", last="1"
>>     [java]  + [DEBUG] element-decls: rng:ref(), name="body",
>> position="1", last="1"
>>     [java]  + [DEBUG] element-decls: rng:ref(), name="related-links",
>> position="1", last="1"
>>     [java]  + [DEBUG] element-decls: rng:ref(),
>> name="mytopic-info-types", position="1", last="1"
>>
>>
>> (Although I notice looking at these results that abstract and shortdesc,
>> which are siblings, do not report the expected position() or last()
>> values, so something is not right here.
>>
>> With 9.7 I get these results:
>>
>>     [java]  + [DEBUG] element-decls: rng:ref(), name="info-types",
>> position="2", last="3"
>>     [java]  + [DEBUG] element-decls: rng:ref(), name="titlealts",
>> position="2", last="3"
>>     [java]  + [DEBUG] element-decls: rng:ref(), name="abstract",
>> position="1", last="1"
>>     [java]  + [DEBUG] element-decls: rng:ref(), name="shortdesc",
>> position="1", last="1"
>>     [java]  + [DEBUG] element-decls: rng:ref(), name="prolog",
>> position="2", last="3"
>>     [java]  + [DEBUG] element-decls: rng:ref(), name="body",
>> position="2", last="3"
>>     [java]  + [DEBUG] element-decls: rng:ref(), name="related-links",
>> position="2", last="3"
>>     [java]  + [DEBUG] element-decls: rng:ref(),
>> name="mytopic-info-types", position="2", last="3"
>>
>>
>> For all but abstract and shortdesc, the position() and last() values are
>> different and also not what was expected.
>>
>> The transform and source I'm using is available here:
>>
>>
>>https://github.com/oasis-open/dita-rng-converter/commit/c5dbc3379e0b7b668
>>4e
>> 38fa63439e391fbb34a47
>>
>> The command line I'm running is:
>>
>> ant generate-dtd
>> -DdoctypesDir=test/specializations/org.example/1.3/rng/mytopic
>> -Doutdir=test/specializations/org.example -DgenerateCatalogs=true
>> -DgenerateModules=true -Ddebug=false
>>
>>
>> I think the abstract and shortdesc results are explained by this code:
>>
>> <xsl:for-each select="rng:*">
>>      <xsl:if test="not(position()=1)">
>>        <xsl:text> |&#x0a;</xsl:text>
>>      </xsl:if>
>>      <xsl:apply-templates select="." mode="#current" />
>>    </xsl:for-each>
>>
>> Which is used for choice groups, which abstract and shortdesc are
>>children
>> of. In that case, each group has size 1 so the 1/1 result makes sense.
>>
>>
>> But the other results make no sense that I can see and there is
>>definitely
>> a difference from 9.6 to 9.7.
>>
>> It also looks like my code works by accident with 9.6 but definitely
>>fails
>> with 9.7.
>>
>> Cheers,
>>
>> Eliot
>>
>> ----
>> Eliot Kimber, Owner
>> Contrext, LLC
>> http://contrext.com
>>
>>
>>
>>
>>
>>-------------------------------------------------------------------------
>>-----
>> What NetFlow Analyzer can do for you? Monitors network bandwidth and
>>traffic
>> patterns at an interface-level. Reveals which users, apps, and
>>protocols are
>> consuming the most bandwidth. Provides multi-vendor support for
>>NetFlow,
>> J-Flow, sFlow and other flows. Make informed decisions using capacity
>> planning reports.
>>https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
>> _______________________________________________
>> saxon-help mailing list archived at http://saxon.markmail.org/
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/saxon-help
>
>
>
>--------------------------------------------------------------------------
>----
>What NetFlow Analyzer can do for you? Monitors network bandwidth and
>traffic
>patterns at an interface-level. Reveals which users, apps, and protocols
>are
>consuming the most bandwidth. Provides multi-vendor support for NetFlow,
>J-Flow, sFlow and other flows. Make informed decisions using capacity
>planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
>_______________________________________________
>saxon-help mailing list archived at http://saxon.markmail.org/
>[hidden email]
>https://lists.sourceforge.net/lists/listinfo/saxon-help
>



------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Incorrect/Different Result for postion() from Saxon 9.6 to 9.7

Michael Kay-2
Is there any chance you could isolate the necessary so we can just work with a single transformation? Trying to get all the configuration in place to run the ant script is a bit of a nightmare. We can't do much with the fragments of code either. The chances are that this bug is an over-aggressive optimization, e.g. moving something out of a loop that ought not to be moved, and the causes of such problems are often remote from the fragment of code that's misbehaving.

Michael Kay
Saxonica


> On 9 Jun 2016, at 21:34, Eliot Kimber <[hidden email]> wrote:
>
> Glad to help :-)
>
> I rewrote my code to use "count(following-sibling::rng:*) gt 0" and that
> of course works around the reported behavior.
>
> Cheers,
>
> E.
> ----
> Eliot Kimber, Owner
> Contrext, LLC
> http://contrext.com
>
>
>
>
> On 6/9/16, 3:20 PM, "Michael Kay" <[hidden email]> wrote:
>
>> Thanks for reporting. Please track this one here:
>>
>> https://saxonica.plan.io/issues/2788
>>
>> Michael Kay
>> Saxonica
>>
>>
>>> On 9 Jun 2016, at 19:16, Eliot Kimber <[hidden email]> wrote:
>>>
>>> I have code like this:
>>>
>>> <xsl:if test="not(position() = last())">
>>>             <xsl:text>,</xsl:text>
>>>           </xsl:if>
>>>
>>> When I run this transform under Saxon 9.6.0.7 (the version of 9.6 I had
>>> lying about) I get the expected result from my data set.
>>>
>>> However, when I run with 9.7.0.1 or 9.7.0.5 I appear to get the position
>>> and next for the parent of the context element.
>>>
>>> The source XML is:
>>>
>>>
>>> <define name="mytopic.content">
>>>       <ref name="title"/>
>>>       <optional>
>>>         <ref name="titlealts"/>
>>>       </optional>
>>>       <optional>
>>>         <choice>
>>>           <ref name="abstract"/>
>>>           <ref name="shortdesc"/>
>>>         </choice>
>>>       </optional>
>>>       <optional>
>>>         <ref name="prolog"/>
>>>       </optional>
>>>       <optional>
>>>         <ref name="body"/>
>>>       </optional>
>>>       <optional>
>>>         <ref name="related-links"/>
>>>       </optional>
>>>       <zeroOrMore>
>>>         <ref name="mytopic-info-types"/>
>>>       </zeroOrMore>
>>>     </define>
>>>
>>>
>>> And my template is matching on <ref> elements, using the position() =
>>> last() check to determine when to omit commas
>>>
>>>
>>> When I run with 9.6 I get the correct result, and these position() and
>>> last() values:
>>>
>>>    [java]  + [DEBUG] element-decls: rng:ref(), name="info-types",
>>> position="1", last="1"
>>>    [java]  + [DEBUG] element-decls: rng:ref(), name="titlealts",
>>> position="1", last="1"
>>> [java]  + [DEBUG] element-decls: rng:ref(), name="abstract",
>>> position="1",
>>> last="1"
>>>    [java]  + [DEBUG] element-decls: rng:ref(), name="shortdesc",
>>> position="1", last="1"
>>>    [java]  + [DEBUG] element-decls: rng:ref(), name="prolog",
>>> position="1", last="1"
>>>    [java]  + [DEBUG] element-decls: rng:ref(), name="body",
>>> position="1", last="1"
>>>    [java]  + [DEBUG] element-decls: rng:ref(), name="related-links",
>>> position="1", last="1"
>>>    [java]  + [DEBUG] element-decls: rng:ref(),
>>> name="mytopic-info-types", position="1", last="1"
>>>
>>>
>>> (Although I notice looking at these results that abstract and shortdesc,
>>> which are siblings, do not report the expected position() or last()
>>> values, so something is not right here.
>>>
>>> With 9.7 I get these results:
>>>
>>>    [java]  + [DEBUG] element-decls: rng:ref(), name="info-types",
>>> position="2", last="3"
>>>    [java]  + [DEBUG] element-decls: rng:ref(), name="titlealts",
>>> position="2", last="3"
>>>    [java]  + [DEBUG] element-decls: rng:ref(), name="abstract",
>>> position="1", last="1"
>>>    [java]  + [DEBUG] element-decls: rng:ref(), name="shortdesc",
>>> position="1", last="1"
>>>    [java]  + [DEBUG] element-decls: rng:ref(), name="prolog",
>>> position="2", last="3"
>>>    [java]  + [DEBUG] element-decls: rng:ref(), name="body",
>>> position="2", last="3"
>>>    [java]  + [DEBUG] element-decls: rng:ref(), name="related-links",
>>> position="2", last="3"
>>>    [java]  + [DEBUG] element-decls: rng:ref(),
>>> name="mytopic-info-types", position="2", last="3"
>>>
>>>
>>> For all but abstract and shortdesc, the position() and last() values are
>>> different and also not what was expected.
>>>
>>> The transform and source I'm using is available here:
>>>
>>>
>>> https://github.com/oasis-open/dita-rng-converter/commit/c5dbc3379e0b7b668
>>> 4e
>>> 38fa63439e391fbb34a47
>>>
>>> The command line I'm running is:
>>>
>>> ant generate-dtd
>>> -DdoctypesDir=test/specializations/org.example/1.3/rng/mytopic
>>> -Doutdir=test/specializations/org.example -DgenerateCatalogs=true
>>> -DgenerateModules=true -Ddebug=false
>>>
>>>
>>> I think the abstract and shortdesc results are explained by this code:
>>>
>>> <xsl:for-each select="rng:*">
>>>     <xsl:if test="not(position()=1)">
>>>       <xsl:text> |&#x0a;</xsl:text>
>>>     </xsl:if>
>>>     <xsl:apply-templates select="." mode="#current" />
>>>   </xsl:for-each>
>>>
>>> Which is used for choice groups, which abstract and shortdesc are
>>> children
>>> of. In that case, each group has size 1 so the 1/1 result makes sense.
>>>
>>>
>>> But the other results make no sense that I can see and there is
>>> definitely
>>> a difference from 9.6 to 9.7.
>>>
>>> It also looks like my code works by accident with 9.6 but definitely
>>> fails
>>> with 9.7.
>>>
>>> Cheers,
>>>
>>> Eliot
>>>
>>> ----
>>> Eliot Kimber, Owner
>>> Contrext, LLC
>>> http://contrext.com
>>>
>>>
>>>
>>>
>>>
>>> -------------------------------------------------------------------------
>>> -----
>>> What NetFlow Analyzer can do for you? Monitors network bandwidth and
>>> traffic
>>> patterns at an interface-level. Reveals which users, apps, and
>>> protocols are
>>> consuming the most bandwidth. Provides multi-vendor support for
>>> NetFlow,
>>> J-Flow, sFlow and other flows. Make informed decisions using capacity
>>> planning reports.
>>> https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
>>> _______________________________________________
>>> saxon-help mailing list archived at http://saxon.markmail.org/
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/saxon-help
>>
>>
>>
>> --------------------------------------------------------------------------
>> ----
>> What NetFlow Analyzer can do for you? Monitors network bandwidth and
>> traffic
>> patterns at an interface-level. Reveals which users, apps, and protocols
>> are
>> consuming the most bandwidth. Provides multi-vendor support for NetFlow,
>> J-Flow, sFlow and other flows. Make informed decisions using capacity
>> planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
>> _______________________________________________
>> saxon-help mailing list archived at http://saxon.markmail.org/
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/saxon-help
>>
>
>
>
> ------------------------------------------------------------------------------
> What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
> patterns at an interface-level. Reveals which users, apps, and protocols are
> consuming the most bandwidth. Provides multi-vendor support for NetFlow,
> J-Flow, sFlow and other flows. Make informed decisions using capacity
> planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
> _______________________________________________
> saxon-help mailing list archived at http://saxon.markmail.org/
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/saxon-help 



------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Incorrect/Different Result for postion() from Saxon 9.6 to 9.7

Eliot Kimber-2
I can see what I can do. I realized after I posted that the transform
requires a copy of a recent Open Toolkit in order to resolve the
references in the RNG files being processed. I can remove that requirement
and try to make a single XSLT.

Cheers,

E.

----
Eliot Kimber, Owner
Contrext, LLC
http://contrext.com




On 6/9/16, 4:03 PM, "[hidden email]" <[hidden email]> wrote:

>Is there any chance you could isolate the necessary so we can just work
>with a single transformation? Trying to get all the configuration in
>place to run the ant script is a bit of a nightmare. We can't do much
>with the fragments of code either. The chances are that this bug is an
>over-aggressive optimization, e.g. moving something out of a loop that
>ought not to be moved, and the causes of such problems are often remote
>from the fragment of code that's misbehaving.
>
>Michael Kay
>Saxonica
>
>
>> On 9 Jun 2016, at 21:34, Eliot Kimber <[hidden email]> wrote:
>>
>> Glad to help :-)
>>
>> I rewrote my code to use "count(following-sibling::rng:*) gt 0" and that
>> of course works around the reported behavior.
>>
>> Cheers,
>>
>> E.
>> ----
>> Eliot Kimber, Owner
>> Contrext, LLC
>> http://contrext.com
>>
>>
>>
>>
>> On 6/9/16, 3:20 PM, "Michael Kay" <[hidden email]> wrote:
>>
>>> Thanks for reporting. Please track this one here:
>>>
>>> https://saxonica.plan.io/issues/2788
>>>
>>> Michael Kay
>>> Saxonica
>>>
>>>
>>>> On 9 Jun 2016, at 19:16, Eliot Kimber <[hidden email]> wrote:
>>>>
>>>> I have code like this:
>>>>
>>>> <xsl:if test="not(position() = last())">
>>>>             <xsl:text>,</xsl:text>
>>>>           </xsl:if>
>>>>
>>>> When I run this transform under Saxon 9.6.0.7 (the version of 9.6 I
>>>>had
>>>> lying about) I get the expected result from my data set.
>>>>
>>>> However, when I run with 9.7.0.1 or 9.7.0.5 I appear to get the
>>>>position
>>>> and next for the parent of the context element.
>>>>
>>>> The source XML is:
>>>>
>>>>
>>>> <define name="mytopic.content">
>>>>       <ref name="title"/>
>>>>       <optional>
>>>>         <ref name="titlealts"/>
>>>>       </optional>
>>>>       <optional>
>>>>         <choice>
>>>>           <ref name="abstract"/>
>>>>           <ref name="shortdesc"/>
>>>>         </choice>
>>>>       </optional>
>>>>       <optional>
>>>>         <ref name="prolog"/>
>>>>       </optional>
>>>>       <optional>
>>>>         <ref name="body"/>
>>>>       </optional>
>>>>       <optional>
>>>>         <ref name="related-links"/>
>>>>       </optional>
>>>>       <zeroOrMore>
>>>>         <ref name="mytopic-info-types"/>
>>>>       </zeroOrMore>
>>>>     </define>
>>>>
>>>>
>>>> And my template is matching on <ref> elements, using the position() =
>>>> last() check to determine when to omit commas
>>>>
>>>>
>>>> When I run with 9.6 I get the correct result, and these position() and
>>>> last() values:
>>>>
>>>>    [java]  + [DEBUG] element-decls: rng:ref(), name="info-types",
>>>> position="1", last="1"
>>>>    [java]  + [DEBUG] element-decls: rng:ref(), name="titlealts",
>>>> position="1", last="1"
>>>> [java]  + [DEBUG] element-decls: rng:ref(), name="abstract",
>>>> position="1",
>>>> last="1"
>>>>    [java]  + [DEBUG] element-decls: rng:ref(), name="shortdesc",
>>>> position="1", last="1"
>>>>    [java]  + [DEBUG] element-decls: rng:ref(), name="prolog",
>>>> position="1", last="1"
>>>>    [java]  + [DEBUG] element-decls: rng:ref(), name="body",
>>>> position="1", last="1"
>>>>    [java]  + [DEBUG] element-decls: rng:ref(), name="related-links",
>>>> position="1", last="1"
>>>>    [java]  + [DEBUG] element-decls: rng:ref(),
>>>> name="mytopic-info-types", position="1", last="1"
>>>>
>>>>
>>>> (Although I notice looking at these results that abstract and
>>>>shortdesc,
>>>> which are siblings, do not report the expected position() or last()
>>>> values, so something is not right here.
>>>>
>>>> With 9.7 I get these results:
>>>>
>>>>    [java]  + [DEBUG] element-decls: rng:ref(), name="info-types",
>>>> position="2", last="3"
>>>>    [java]  + [DEBUG] element-decls: rng:ref(), name="titlealts",
>>>> position="2", last="3"
>>>>    [java]  + [DEBUG] element-decls: rng:ref(), name="abstract",
>>>> position="1", last="1"
>>>>    [java]  + [DEBUG] element-decls: rng:ref(), name="shortdesc",
>>>> position="1", last="1"
>>>>    [java]  + [DEBUG] element-decls: rng:ref(), name="prolog",
>>>> position="2", last="3"
>>>>    [java]  + [DEBUG] element-decls: rng:ref(), name="body",
>>>> position="2", last="3"
>>>>    [java]  + [DEBUG] element-decls: rng:ref(), name="related-links",
>>>> position="2", last="3"
>>>>    [java]  + [DEBUG] element-decls: rng:ref(),
>>>> name="mytopic-info-types", position="2", last="3"
>>>>
>>>>
>>>> For all but abstract and shortdesc, the position() and last() values
>>>>are
>>>> different and also not what was expected.
>>>>
>>>> The transform and source I'm using is available here:
>>>>
>>>>
>>>>
>>>>https://github.com/oasis-open/dita-rng-converter/commit/c5dbc3379e0b7b6
>>>>68
>>>> 4e
>>>> 38fa63439e391fbb34a47
>>>>
>>>> The command line I'm running is:
>>>>
>>>> ant generate-dtd
>>>> -DdoctypesDir=test/specializations/org.example/1.3/rng/mytopic
>>>> -Doutdir=test/specializations/org.example -DgenerateCatalogs=true
>>>> -DgenerateModules=true -Ddebug=false
>>>>
>>>>
>>>> I think the abstract and shortdesc results are explained by this code:
>>>>
>>>> <xsl:for-each select="rng:*">
>>>>     <xsl:if test="not(position()=1)">
>>>>       <xsl:text> |&#x0a;</xsl:text>
>>>>     </xsl:if>
>>>>     <xsl:apply-templates select="." mode="#current" />
>>>>   </xsl:for-each>
>>>>
>>>> Which is used for choice groups, which abstract and shortdesc are
>>>> children
>>>> of. In that case, each group has size 1 so the 1/1 result makes sense.
>>>>
>>>>
>>>> But the other results make no sense that I can see and there is
>>>> definitely
>>>> a difference from 9.6 to 9.7.
>>>>
>>>> It also looks like my code works by accident with 9.6 but definitely
>>>> fails
>>>> with 9.7.
>>>>
>>>> Cheers,
>>>>
>>>> Eliot
>>>>
>>>> ----
>>>> Eliot Kimber, Owner
>>>> Contrext, LLC
>>>> http://contrext.com
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>-----------------------------------------------------------------------
>>>>--
>>>> -----
>>>> What NetFlow Analyzer can do for you? Monitors network bandwidth and
>>>> traffic
>>>> patterns at an interface-level. Reveals which users, apps, and
>>>> protocols are
>>>> consuming the most bandwidth. Provides multi-vendor support for
>>>> NetFlow,
>>>> J-Flow, sFlow and other flows. Make informed decisions using capacity
>>>> planning reports.
>>>> https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
>>>> _______________________________________________
>>>> saxon-help mailing list archived at http://saxon.markmail.org/
>>>> [hidden email]
>>>> https://lists.sourceforge.net/lists/listinfo/saxon-help
>>>
>>>
>>>
>>>
>>>------------------------------------------------------------------------
>>>--
>>> ----
>>> What NetFlow Analyzer can do for you? Monitors network bandwidth and
>>> traffic
>>> patterns at an interface-level. Reveals which users, apps, and
>>>protocols
>>> are
>>> consuming the most bandwidth. Provides multi-vendor support for
>>>NetFlow,
>>> J-Flow, sFlow and other flows. Make informed decisions using capacity
>>> planning reports.
>>>https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
>>> _______________________________________________
>>> saxon-help mailing list archived at http://saxon.markmail.org/
>>> [hidden email]
>>> https://lists.sourceforge.net/lists/listinfo/saxon-help
>>>
>>
>>
>>
>>
>>-------------------------------------------------------------------------
>>-----
>> What NetFlow Analyzer can do for you? Monitors network bandwidth and
>>traffic
>> patterns at an interface-level. Reveals which users, apps, and
>>protocols are
>> consuming the most bandwidth. Provides multi-vendor support for
>>NetFlow,
>> J-Flow, sFlow and other flows. Make informed decisions using capacity
>> planning reports.
>>https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
>> _______________________________________________
>> saxon-help mailing list archived at http://saxon.markmail.org/
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/saxon-help
>
>
>
>--------------------------------------------------------------------------
>----
>What NetFlow Analyzer can do for you? Monitors network bandwidth and
>traffic
>patterns at an interface-level. Reveals which users, apps, and protocols
>are
>consuming the most bandwidth. Provides multi-vendor support for NetFlow,
>J-Flow, sFlow and other flows. Make informed decisions using capacity
>planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
>_______________________________________________
>saxon-help mailing list archived at http://saxon.markmail.org/
>[hidden email]
>https://lists.sourceforge.net/lists/listinfo/saxon-help
>



------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
_______________________________________________
saxon-help mailing list archived at http://saxon.markmail.org/
[hidden email]
https://lists.sourceforge.net/lists/listinfo/saxon-help 
Loading...