Project

Profile

Help

Bug #2563

closed

NPE in export when inferred type involves an aliased namespace

Added by John Lumley over 8 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Internals
Sprint/Milestone:
-
Start date:
2015-12-29
Due date:
% Done:

100%

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

Description

In cases where the inferred type of a sequence constructor involves a namespace that is aliased, the export action throws a NPE when recording the type of the sequence. This is shown in the following:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:X="XSL" exclude-result-prefixes="xs" version="3.0">
    <xsl:namespace-alias stylesheet-prefix="X" result-prefix="xsl"/>
    <xsl:template name="main">
        <xsl:variable name="properties" as="item()*">
            <X:attribute/>
        </xsl:variable>
        <result>
            <xsl:sequence select="$properties"/>
        </result>
    </xsl:template>
</xsl:stylesheet>

where the NPE is thrown in trying to get a URI from the NamePool for the inferred type of @$properties@: '@element(X:attribute)@'.

Changing the namespace to one that is not aliased gives correct behaviour.

The FixedElement.elementName does not have a fingerprint under these alias conditions (i.e. it's -1, possibly masked), but it does have the correctly aliased qname (i.e. in this case @xsl:attribute@).

Please register to edit this issue

Also available in: Atom PDF