This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 14448 - Chameleon transformations
Summary: Chameleon transformations
Status: CLOSED FIXED
Alias: None
Product: XML Schema
Classification: Unclassified
Component: Structures: XSD Part 1 (show other bugs)
Version: 1.1 only
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: David Ezell
QA Contact: XML Schema comments list
URL:
Whiteboard:
Keywords: resolved
Depends on:
Blocks:
 
Reported: 2011-10-13 11:44 UTC by Michael Kay
Modified: 2012-01-06 23:44 UTC (History)
1 user (show)

See Also:


Attachments
non-schema-aware version of chameleon include transformation (3.44 KB, text/xml)
2011-12-28 20:46 UTC, C. M. Sperberg-McQueen
Details
revised schema-oblivious stylesheet (3.54 KB, text/xml)
2011-12-29 01:58 UTC, C. M. Sperberg-McQueen
Details

Description Michael Kay 2011-10-13 11:44:58 UTC
The XSLT transformation for chameleon schema documents appears not to handle some attributes that can contain QNames. It handles any attribute typed as a QName, and it handles the memberTypes attribute of xs:union (which is a list of QNames), but it does not handle:

xs:element/@substitutionGroup (also a list of QNames)

xs:any/@notQName (a list that can include QNames inter alia)

It is presumably by design that it does not tamper with XPath expressions, which may also contain unprefixed QNames.
Comment 1 David Ezell 2011-10-21 15:40:25 UTC
WG agrees, marking as needsDrafting since MSM may have further input.
Comment 2 C. M. Sperberg-McQueen 2011-12-28 20:46:36 UTC
Created attachment 1057 [details]
non-schema-aware version of chameleon include transformation

I believe it doesn't tamper with XPath expressions because the WG was persuaded that the right thing to do was to specify that XPath expressions in a chameleon-included document could and should be interpreted with the new target namespace as the default namespace.

I attach a version of the chameleon include stylesheet (not yet tested) which handles all the attributes declared in the schema for schemas as being or including QNames.
Comment 3 C. M. Sperberg-McQueen 2011-12-29 01:58:24 UTC
Created attachment 1058 [details]
revised schema-oblivious stylesheet

I've now tested the revised stylesheet on a simple schema document and have corrected a couple of errors in the earlier attachment.
Comment 4 Michael Kay 2011-12-29 10:56:16 UTC
I have compared this carefully with the version I have been using internally in my implementation. Generally it looks OK and better than my attempt.

I think that the only fault I can find is that it would be better to replace

resolve-QName(string(.), ..)

with

resolve-QName(normalize-space(.), ..)

on lines 34 and 38, because resolve-QName (probably) does not strip leading and trailing whitespace from its argument. (One might also common up this expression into a variable.)
Comment 5 C. M. Sperberg-McQueen 2012-01-02 15:55:36 UTC
The revised transform attached on 29 December (see comment 3) amounts, I guess, to a wording proposal that would resolve this issue.  So I'm marking this bug as needs-review.
Comment 6 C. M. Sperberg-McQueen 2012-01-06 23:36:26 UTC
At its call today the XML Schema WG adopted the proposal to replace the chameleon-include transformation with the version given in an attachment to this issue.  That has now been done and the new version is appearing in the status-quo document, so I'm marking the issue resolved.

Michael, as originator would you check to make sure the change has really been made, and then close the bug?  Thank you.