Project

Profile

Help

Bug #6040

closed

Invalid warning displayed when map:contains() is used

Added by Octavian Nadolu over 1 year ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Diagnostics
Sprint/Milestone:
-
Start date:
2023-05-17
Due date:
% Done:

100%

Estimated time:
Legacy ID:
Applies to branch:
12, trunk
Fix Committed on Branch:
12, trunk
Fixed in Maintenance Release:
Platforms:
.NET, Java

Description

If I transform the following XML with the XSL I obtain an warning. I think that the warning that should not be presented because in the template I match the "element" from the "relevant" parent, and in the XML I have an "irrelevant" parent. Probably an evaluation is made in this case for optimization, but the warning should not be displayed.

I tested with Saxon 11.4

An error occurred matching pattern {element(Q{}element)[Q{http://www.w3.org/2005/xpath-functions/map}contains(exactly-one(($some-map) treat as map(*)), atomizeSingleton(attribute::attribute(Q{}relevant-attribute)))]}: An empty sequence is not allowed as the second argument of map:contains()

<root>
    <irrelevant>
        <element/>
    </irrelevant>
</root>
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="3.0"  xmlns:map="http://www.w3.org/2005/xpath-functions/map">
    <xsl:param name="some-map" select="map {}"/>
    <xsl:template match="/*/relevant/element[map:contains($some-map, @relevant-attribute)]">
    </xsl:template>
</xsl:stylesheet>

Please register to edit this issue

Also available in: Atom PDF