Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Downcasting (relabelling) in the coercion rules #117

Closed
michaelhkay opened this issue Jun 21, 2022 · 1 comment
Closed

Downcasting (relabelling) in the coercion rules #117

michaelhkay opened this issue Jun 21, 2022 · 1 comment
Labels
Enhancement A change or improvement to an existing feature XPath An issue related to XPath XQuery An issue related to XQuery

Comments

@michaelhkay
Copy link
Contributor

The proposed coercion rules (aka function conversion rules) permitting down-casting (aka "relabelling") introduce a backwards incompatibility.

For example in XSLT3 test case as-1711 we have

  <xslt:variable name="var1" select="/doc-schemaas/elem-NMTOKEN" as="xs:token"/>

   <xslt:template match="/doc-schemaas">
            <xslt:value-of select="$var1 instance of xs:NMTOKEN"/>
   </xslt:template> 

where the result of atomising elem-NMTOKEN is of type xs:NMTOKEN.

Under the new rules this is "relabelled" as xs:token, causing the "instance of" test to return false, where in XSLT 2.0/3.0 it returned true.

I think the relabelling rules should probably be amended so that if the supplied value is already an instance of the required type, no relabelling takes place - it retains its existing type.

@michaelhkay
Copy link
Contributor Author

Fixed as suggested

michaelhkay added a commit that referenced this issue Sep 13, 2022
@rhdunn rhdunn added XPath An issue related to XPath XQuery An issue related to XQuery Enhancement A change or improvement to an existing feature Accepted labels Sep 15, 2022
@rhdunn rhdunn added this to the QT 4.0 milestone Sep 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement A change or improvement to an existing feature XPath An issue related to XPath XQuery An issue related to XQuery
Projects
None yet
Development

No branches or pull requests

2 participants