Project

Profile

Help

Bug #1954

closed

Problem with some predicates when xsl:fallback is in use

Added by Nick Nunes over 10 years ago. Updated over 10 years ago.

Status:
Duplicate
Priority:
Normal
Assignee:
Category:
XSLT conformance
Sprint/Milestone:
-
Start date:
2013-12-11
Due date:
% Done:

0%

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

Description

In Saxon-EE 9.5.1.2 (bundled with Oxygen 15.1, build 2013101713) there seems to be a problem when evaluating predicates with equality tests from a variable that might be a document-node() which has a fallback instruction.

A stylesheet which demonstrates this error can be found here and is also attached:

https://gist.github.com/nine9ths/7918271


Files

saxon.fallback.bug.xsl (1.49 KB) saxon.fallback.bug.xsl Nick Nunes, 2013-12-11 22:00

Related issues

Related to Saxon - Bug #1927: Spurious error optimising void filter expressionClosedMichael Kay2013-10-28

Actions
Actions #1

Updated by Michael Kay over 10 years ago

  • Category set to XSLT conformance
  • Status changed from New to In Progress
  • Priority changed from Low to Normal

Thanks for reporting it. So far I haven't been able to reproduce it. Presumably there is no implementation of the extension, so the fallback action should be taken?

When you say (in the xsl:message) "Remove this and the error clears" what exactly does "this" refer to?

It's possible the bug is oXygen specific. I'm currently on an older oxygen release (which shows no problem) but I will upgrade and try it again when I have done so.

I have provisionally added the test case to the W3C test suite (as xslt-compat-013). If you have any objections to it being published in this way, please let me know, and I will revert.

The error messages you report are very strange, I haven't a clue what's going on and won't be able to solve it without reproducing it.

Actions #2

Updated by Michael Kay over 10 years ago

I'm now running it in oxygen 15.1 build 2013110816, and can't reproduce the error. Could you try the latest build level please? If the problem persists, please let me know exactly what you are doing to run the stylesheet.

Actions #3

Updated by Radu Pisoi over 10 years ago

Hello,

I have tried to reproduce the problem and what I have noticed is that there are different behaviors when running the transformation with different Saxon distributions (EE, PE). I have tested in the command line.

When I run the transformation with Saxon PE the output is empty and there are no errors reported. With Saxon EE I get 2 compilation errors:

d:\workspace\eXml>java -cp lib\saxon9ee.jar;lib\notDistributed\saxon-license.lic net.sf.saxon.Transform 
-s:samples/personal.xml -xsl:saxon.fallback.bug.xsl -config:saxonConf.xml

Error on line 23 of saxon.fallback.bug.xsl:
  XPTY0020: Leading '/' cannot select the root node of the tree containing the context item:
  the context item is an atomic value
Error on line 23 of saxon.fallback.bug.xsl:
  XPTY0020: Leading '/' cannot select the root node of the tree containing the context item:
  the context item is an atomic value
Failed to compile stylesheet. 1 error detected.

To select a different Saxon distribution I have used a configuration file like this:

<configuration
  edition="EE"
  xmlns="http://saxon.sf.net/ns/configuration"/>

From the command line I have used the Saxon 9.5.1.2 version, the same version that is bundled with oXygen 15.1 version. The transformation result was the same when I executed the transformation from the command line or from oXygen with the same Saxon distribution.

I hope this helps in identifying the issue.

--

Regards,

Radu

Radu Pisoi

XML Editor, Schema Editor and XSLT Editor/Debugger

http://www.oxygenxml.com

Actions #4

Updated by Nick Nunes over 10 years ago

I'm actually getting these errors from the live validation in Oxygen, I wasn't even attempting to run the stylesheet, but if I do attempt to run the stylesheet against another file I get the same errors. I can also confirm that this error is only coming from Saxon EE, neither HE or PE complains. The error persists after upgrading Oxygen to build 2013110816.

If it makes any difference I'm on OS X 10.9, build 13A3017 with Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609).

"Remove this and the error clears" in the ext:instruction refers to the xsl:fallback. I've updated the gist to reflect this it now says:

    <xsl:variable name="test" as="document-node(element(foo))?">
      <ext:instruction>
        <!-- If the xsl:fallback here is removed the error clears -->
        <xsl:fallback/>
      </ext:instruction>
    </xsl:variable>

I don't have any problems with these being added to the test suite.

Actions #5

Updated by Nick Nunes over 10 years ago

I'll also add that if the xsl:fallback is non-empty the error clears. E.g.

<xsl:variable name="test" as="document-node(element(foo))?">
      <ext:instruction>
        <xsl:fallback>
          <xsl:document>
            <foo/>
          </xsl:document>
        </xsl:fallback>
      </ext:instruction>
    </xsl:variable>

It seems like the empty xsl:fallback element is possibly being evaluated as an empty string rather than as an empty sequence.

Actions #6

Updated by Michael Kay over 10 years ago

  • Assignee set to Michael Kay

OK, I have now reproduced this on both 9.5.1.2 and 9.5.1.3 running from the command line: but I can't reproduce it running my development version in the IDE. This either means that the bug has been fixed since 9.5.1.3 was built, or that there's some difference between the way I'm running it in the two cases.

Actions #7

Updated by Michael Kay over 10 years ago

OK, I think it's almost certainly this bug here:

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

whose resolution will appear in the next maintenance release.

Actions #8

Updated by Michael Kay over 10 years ago

  • Status changed from In Progress to Duplicate

Please register to edit this issue

Also available in: Atom PDF