Re: problems with trang making xsd, mixed="true"
Atsushi Eno <[email protected]> Tue, 30 Nov 2004 18:15:07 +0900
| Newsgroups | gmane.text.xml.relaxng.general |
|---|---|
| Message-ID | <[email protected]> |
Hello,
Eric, I don't think you (and MS implementation) are right. Read
the description of {content type} in 3.4.2 "Complex Type
Definition with complex content Schema Component" (well, I know
you must have read there so many times :-)
In 3.2.1, it specifies that in case of extension and it's
effective content is empty, then its {content type} is "the
{content type} of the type definition -resolved- to by the
-actual value- of the base [attribute]".
Note that this is the definition, and once {content type} is
computed, "effective content" is nothing to do with the
constraints on complex type component.
So in this case, the derived type's {content type} must not be
different from that of base type by definition.
I'll report this bug to MS later, unless it turns out that
I am wrong.
Atsushi Eno
Eric van der Vlist wrote:
> Hi Sebastian,
>=20
> On Mon, 2004-11-29 at 23:56 +0000, Sebastian Rahtz wrote:
>=20
>>My schema has this:
>>
>> <rng:define name=3D"docAuthor">
>> <rng:element name=3D"docAuthor">
>> <rng:ref name=3D"macro.phraseSeq"/>
>> <rng:ref name=3D"docAuthor.attributes"/>
>> </rng:element>
>> </rng:define>
>>
>>where macro.phraseSeq is
>>
>> <rng:define name=3D"macro.phraseSeq">
>> <rng:zeroOrMore>
>> <rng:ref name=3D"macro.phrasegroup"/>
>> </rng:zeroOrMore>
>> </rng:define>
>>
>>
>>This translate with trang into
>>
>> <xsd:element name=3D"docAuthor">
>> <xsd:complexType>
>> <xsd:complexContent>
>> <xsd:extension base=3D"ns1:macro.phraseSeq">
>> <xsd:attributeGroup ref=3D"ns1:docAuthor.attributes"/>
>> </xsd:extension>
>> </xsd:complexContent>
>> </xsd:complexType>
>> </xsd:element>
>>
>>and
>>
>> <xsd:complexType name=3D"macro.phraseSeq" mixed=3D"true">
>> <xsd:group minOccurs=3D"0" maxOccurs=3D"unbounded"=20
>>ref=3D"ns1:macro.phrasegroup"/>
>> </xsd:complexType>
>>
>>which looks fine. Most tests pass it OK.
>>But the Microsoft parser says "The derived type and the base type
>>must have the same content type" because docAuthor does not say
>>it is "mixed=3D'true'".
>>
>>Can anyone explain to me
>>
>> a) is Microsoft correct?
>=20
>=20
> With W3C XML Schema, it's always difficult to be sure but here is what =
I
> have written on the subject a while ago :
>=20
> http://lists.w3.org/Archives/Public/xmlschema-dev/2001Oct/0113.html
>=20
>=20
> Also, http://w3.org/TR/xmlschema-1/#Complex_Type_Definitions says:
>=20
> <quote>
> [Definition:] Let the effective mixed be the appropriate case among
> the following:
> 1.1 If the mixed [attribute] is present on <complexContent>, then its
> =B7actual value=B7;
> 1.2 If the mixed [attribute] is present on <complexType>, then its
> =B7actual value=B7;
> 1.3 otherwise false.
> </quote>
>=20
> and later on :
>=20
> <quote>
> 1.4.3.2.2.1 Both {content type}s must be mixed or both must be
> element-only.
> </quote>
>=20
> To make it short, I *think* that on this one, Microsoft is right and
> trang is wrong.
>=20
>=20
>> b) whether I can fix this in any way, short of writing a transform of
>> the XSD?
>=20
>=20
> What about trying to isolate a simpler repro case and=20
>=20
> a) send a mail to James Clark
> b) see if by rewriting the RNG schema you can work around this behavior
>=20
> ???
>=20
>=20
>>yours depressed by Microsoft again
>=20
>=20
> That's depressing for sure but in that case, I find W3C XML Schema the
> depressing factor, not Microsoft!
>=20
> Hope this helps.
>=20
> Eric
>=20
>=20
>>Sebastian
>>