Project

Profile

Help

Bug #1872

closed

doc-available() fails with error on XML parse error

Added by Adrian Buza over 10 years ago. Updated over 10 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
XPath conformance
Sprint/Milestone:
-
Start date:
2013-08-27
Due date:
% Done:

100%

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

Description

The XPath specification for doc-available mentions that an error can be raised only if the used URI is not valid according to the rules applied by the implementation of fn:doc. Otherwise, if unsuccessful, the function should return false.

http://www.w3.org/TR/xpath-functions/#func-doc-available

One of our Oxygen users reported that this is not the case of Saxon 9.5 and doc-available raises a SXXP0003 error.

We've tested with these files:

bad.xml

<bad>content & stuff</bad>

test.xsl

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    version="2.0">
    <xsl:template name="start">
        <xsl:if test="doc-available('bad.xml')">
            <xsl:message>worked</xsl:message>
        </xsl:if>
    </xsl:template>
</xsl:stylesheet>

When running Saxon 9.5.0.2 in the command line:

java -cp saxon9ee.jar net.sf.saxon.Transform -xsl:test.xsl -it:start

the transformation fails with an error:

Error on line 1 column 15 of bad.xml:
  SXXP0003: Error reported by XML parser: The entity name must immediately follow the '&' in
  the entity reference.
<?xml version="1.0" encoding="UTF-8"?>

I've also tested this with older versions of Oxygen/Saxon 9 and this seems to go back at least as far as Saxon 9.1.

Seems related to:

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


Related issues

Related to Saxon - Bug #89: doc-available() outputs error message on XML parse errorClosed

Actions
Related to Saxon - Bug #1849: ValidationException reported to ErrorListener even if in try/catchClosedMichael Kay2013-07-20

Actions

Please register to edit this issue

Also available in: Atom PDF