Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: [xml-dev] XML Schema: Chameleon Redefine Pervasiveness Puzzle

From: "Michael Kay" <mike@--------.--->
To: "'Paul Hermans'" <paul.hermans@--------.--->,"'xml-dev'" <xml-dev@-----.---.--->
Date: 4/5/2008 11:44:00 AM
The specification is hopelessly unclear about this kind of situation. My
belief is that a chameleon include creates a copy of the original
definition; your two redefinitions therefore apply to different types and
are therefore compatible with each other. Your schema has the "sought-after"
functionality. However, I think you are in territory where one cannot
criticize products that have interpreted the spec in a different way. I
think schemas that are built making heavy use of xs:redefine are likely to
be fragile and therefore best avoided.

Michael Kay
http://www.saxonica.com/

> -----Original Message-----
> From: Paul Hermans [mailto:paul.hermans@a...] 
> Sent: 04 April 2008 17:12
> To: xml-dev
> Subject: [xml-dev] XML Schema: Chameleon Redefine Pervasiveness Puzzle
> 
> Start Situation
> ----------------
> Schema A: no target namespace
> 1 simpleType "T" being a union of a specific "enumeration of QNames"  
> and "QNames".
> Rationale: The enumeration must be restrictable and/or extensible.
> 
> Schema B: targetnamespace 'B'
> includes Schema A as a chameleon
> hence simpleType "T" becomes part of the namespace 'B': {B}:T 
> one element {B}:a has datatype simpleType {B}:T
> 
> Schema C: targetnamespace 'C'
> includes Schema A as a chameleon
> hence simpleType "T" becomes part of the namespace 'C': {C}:T 
> one element {C}:x has datatype simpleType {C}:T
> 
> Schema D: targetnamespace 'D'
> imports Schema B and Schema C.
> 
> Redefine with 2 schemafiles added
> ---------------------------------
> Schema BB: targetnamespace 'B'
> redefines Schema B
> by extending the enumeration in simpleType {B}:T
> 
> Schema CC: targetnamespace 'C'
> redefines Schema C
> by restricting the enumeration in simpleType {C}:T
> 
> Schema D: targetnamespace 'D'
> imports now schema 'BB' and schema 'CC'
> 
> Functionality sought-after:
> element {B}:a can use a value of the extended enumeration 
> element {C}:x can only use values from the restricted enumeration
> 
> Pervasive impact
> ----------------
> Redefinitions replace the original definitions.
> 
> My question is how far this impact goes.
> Possibility 1: Does the redefinition stop at the level of 
> {B}:T and {C}:T in the two schemas with the targetnamespaces?
> Possibility 2: Or goes it one step further by replacing the 
> chameleon datatype 'T', which leads to a conflict since one 
> redefinition is a restriction and the other is an extension.
> Is there one of the redefenitions that takes priority than?
> Anyhow, if possibility 2 is the case than I cannot achieve 
> with redefine the functionality sought-after (see above).
> 
> Is there another option to implement this feature:
> starting with one template enumeration (union) which can be 
> extended in one namespace and restricted in a second without 
> the use of xsi:type?
> 
> Thanks,
> 
> Paul
> 
> 
> 
> 
> 
> 
> ______________________________________________________________
> _________
> 
> XML-DEV is a publicly archived, unmoderated list hosted by 
> OASIS to support XML implementation and development. To 
> minimize spam in the archives, you must subscribe before posting.
> 
> [Un]Subscribe/change address: http://www.oasis-open.org/mlmanage/
> Or unsubscribe: xml-dev-unsubscribe@l...
> subscribe: xml-dev-subscribe@l... List archive: 
> http://lists.xml.org/archives/xml-dev/
> List Guidelines: http://www.oasis-open.org/maillists/guidelines.php
>


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent