- From: Alessandro Triglia <sandro@mclink.it>
- Date: Fri, 5 Nov 2004 15:38:01 +0100 (CET)
- To: xmlschema-dev@w3.org
- Cc: mike@saxonica.com
> -----Original Message----- > From: xmlschema-dev-request@w3.org > [mailto:xmlschema-dev-request@w3.org] On Behalf Of Michael Kay > Sent: Friday, November 05, 2004 08:33 > To: 'Kasimier Buchcik'; xmlschema-dev@w3.org > Subject: RE: Including schemata with duplicate referents > > > > > I have difficulties understanding what to do with included > components > > at sub-schema constrution stage - acting as referents - which > > cannot be included into the final schema. > > You're not alone: I've been finding the spec is a quagmire in > this area. > > > > A simplified example: > > > > - A, B1, B2 and C are schemata > > - B1 includes C and references components of C (referred to as B1.C) > > - B2 includes C and references components of C (referred to as B2.C) > > - A includes B1 and B2 > > > > Since the B1.C components are already included in A, the B2.C > > components > > won't be added to A. The spec states properties of > components to have > > components as their values; the values of components of B2 > > referencing > > B2.C would become unavailable, since not added to A. > > > > You seem to be assuming B1 and B2 contain copies of the > components in C. If > the components retain their identity, I don't think it's a > problem: if a > component in B2 includes a reference to a component in C, > that reference > will be satisfied, because the component will exist in A, > whether it reached > A via B1 or B2. (It gets more complicated, of course, with chameleon > includes). > > The difficulty I have been finding is that inclusion at the > level of schema > components simply doesn't work. Until all the references from a schema > component to other components have been resolved, you need to > keep a lot of > "raw XML" information such as the lexical form of enumeration > values and > their namespace context. Why? Suppose you have a <schema> SII1 with no <import>s and <include>s. The corresponding schema S1 will be built from the information items in SII1. Now you have a <schema> SII1 and its corresponding schema S1. You have another <schema> SII2 that includes the <schema> SII1. According to "Schema Representation Constraint: Inclusion Constraints and Semantics", the corresponding schema S2 will contain both components corresponding to the information items in SII2, and an identical copy of all the components in S1 ("same target namespace" case). Now you have a <schema> SII2 and its corresponding schema S2. You have another <schema> SII3 that imports the schema S2. According to "Schema Representation Constraint: Import Constraints and Semantics", the corresponding schema S3 will contain both components corresponding to he information items in SII3, and an identical copy of all the components in S2. Now you have a <schema> SII3 and its corresponding schema S3. You have another <schema> SII4 that includes the <schema> SII1. According to "Schema Representation Constraint: Inclusion Constraints and Semantics", the corresponding schema S4 will contain both components corresponding to he information items in SII4, and an identical copy of all the components in S1 ("same target namespace" case), with duplicates removed. Now you have a <schema> SII4 and its corresponding schema S4. You have another <schema> SII5 that includes the <schema> SII3. According to "Schema Representation Constraint: Inclusion Constraints and Semantics", the corresponding schema S5 will contain both components corresponding to he information items in SII5, and an identical copy of all the components in S3 ("same target namespace" case), with duplicates removed. Now you have a <schema> SII5 and its corresponding schema S5. My guess is that it should be possible to track the identity of components across inclusions/imports when they are added from one schema to another schema, without keeping any information related to their XML representation. This should also work when the target namespace property is changed, in the case of chameleon schemas. Alessandro > > Michael Kay > http://www.saxonica.com/ > > >
Received on Friday, 5 November 2004 14:38:04 UTC