Project

Profile

Help

Bug #2928

closed

Incorrect xsl:number interpretation

Added by Ken Holman about 8 years ago. Updated about 8 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
XSLT conformance
Sprint/Milestone:
-
Start date:
2016-09-08
Due date:
% Done:

0%

Estimated time:
Legacy ID:
Applies to branch:
Fix Committed on Branch:
Fixed in Maintenance Release:
Platforms:

Description

Saxon-9HE 9.7.0.8J (and earlier versions) incorrectly begin xsl:number level="multiple" at the node matched rather than the ancestral child of the node matched by from="". Saxon 6.5.5 produces the correct result.

I've marked this "high" because it is a conformance issue and it happens to be impacting on my development this month. It has taken me a while to whittle down the evidence to the attached simple example. Below is the transcript running both Saxon-9HE and Saxon.

Thank you for looking at this issue.

. . . . . . . Ken

~/t/ftemp $ java -jar ~/p/xml/xslt/saxon9he/saxon9he.jar

No source file name

Saxon-HE 9.7.0.8J from Saxonica

Usage: see http://www.saxonica.com/html/documentation/using-xsl/commandline.html

Format: net.sf.saxon.Transform options params

Options available: -? -a -catalog -config -cr -diag -dtd -ea -expand -explain -export -ext -im -init -it -l -license -m -nogo -now -o -opt -or -outval -p -pack -quit -r -repeat -s -sa -scmin -strip -t -T -target -threads -TJ -TP -traceout -tree -u -val -versionmsg -warnings -x -xi -xmlversion -xsd -xsdversion -xsiloc -xsl -xsltversion -y

Use -XYZ:? for details of option XYZ

Params:

param=value Set stylesheet string parameter

+param=filename Set stylesheet document parameter

?param=expression Set stylesheet parameter using XPath

!param=value Set serialization parameter

~/t/ftemp $ java -jar ~/p/xml/xslt/saxon9he/saxon9he.jar -xsl:testNumber.xsl -s:testNumber.xml

From the top

1.1.1 First test

1.1.2 Second test

1.1.3 Third test

From one level down

1.1 First test

1.2 Second test

1.3 Third test

~/t/ftemp $ java -jar ~/p/xml/xslt/saxon/saxon.jar

No source file name

SAXON 6.5.5 from Michael Kay

Usage: java com.icl.saxon.StyleSheet [options] source-doc style-doc {param=value}...

Options:

-a Use xml-stylesheet PI, not style-doc argument

-ds Use standard tree data structure

-dt Use tinytree data structure (default)

-o filename Send output to named file or directory

-m classname Use specified Emitter class for xsl:message output

-r classname Use specified URIResolver class

-t Display version and timing information

-T Set standard TraceListener

-TL classname Set a specific TraceListener

-u Names are URLs not filenames

-w0 Recover silently from recoverable errors

-w1 Report recoverable errors and continue (default)

-w2 Treat recoverable errors as fatal

-x classname Use specified SAX parser for source file

-y classname Use specified SAX parser for stylesheet

-? Display this message

~/t/ftemp $ java -jar ~/p/xml/xslt/saxon/saxon.jar testNumber.xml testNumber.xsl

From the top

1.1 First test

1.2 Second test

1.3 Third test

From one level down

1 First test

2 Second test

3 Third test

~/t/ftemp $ cat testNumber.xml

<section role='terms'>

  <here>

    <section>First test</section>

    <section>Second test</section>

    <section>Third test</section>

  </here>

</section>

~/t/ftemp $ cat testNumber.xsl

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"

version="2.0">

<xsl:output method="text"/>

<xsl:template match="/">

xsl:textFrom the top </xsl:text>

<xsl:for-each select="//here/section">

<xsl:number count="section" from="section[parent::test]"

            level="multiple"/>

<xsl:text> </xsl:text>

<xsl:value-of select="."/>

<xsl:text>&#xa;</xsl:text>

</xsl:for-each>

xsl:textFrom one level down </xsl:text>

<xsl:for-each select="//here/section">

<xsl:number count="section" from="section[@role='terms']"

            level="multiple"/>

<xsl:text> </xsl:text>

<xsl:value-of select="."/>

<xsl:text>&#xa;</xsl:text>

</xsl:for-each>

</xsl:template>

</xsl:stylesheet>~/t/ftemp $


Files

gkholman-xslnumber-20160908.zip (1.97 KB) gkholman-xslnumber-20160908.zip Ken Holman, 2016-09-08 17:01

Please register to edit this issue

Also available in: Atom PDF