Project

Profile

Help

Bug #3242

closed

Static type checking error with document-node()

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

Status:
Closed
Priority:
Normal
Assignee:
Category:
XSLT conformance
Sprint/Milestone:
-
Start date:
2017-05-31
Due date:
% Done:

100%

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

Description

I'm getting a static type checking error when testing on whether a variable of type item() is an element() or document-node() in the same expression. The error can be avoid if I do the tests in separate expressions. I've attached some toy stylesheets that demonstrate the error that have been distilled out of a more complex meta-xsl generated stylesheet.

The error I'm getting is:

Static error at char 1 in xsl:copy-of/@select on line 19 column 62 of bug.instance-of-document-node.xsl:

XPTY0004: Required item type of value of variable $ns-cleaned is node(); supplied value has item type xs:string

The relevant portion from the bug stylesheet is:

@

<xsl:when test="(. instance of element()) or (. instance of document-node())">

<xsl:variable name="ns-cleaned" as="item()*">

<xsl:copy-of select="." copy-namespaces="no"/>

</xsl:variable>

<xsl:sequence select="serialize($ns-cleaned)"/>

</xsl:when>

@

If that "or" is split into two different "whens" as in the workaround stylesheet no error is generated.

This problem only seems to be present in Saxon 9.7, I did not get any errors from 9.5. or 9.6.


Files

Please register to edit this issue

Also available in: Atom PDF