[relaxng-user] problems with trang making xsd, mixed="true"

Atsushi Eno atsushi at ximian.com
Tue Nov 30 18:15:07 ICT 2004


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,
> 
> On Mon, 2004-11-29 at 23:56 +0000, Sebastian Rahtz wrote:
> 
>>My schema has this:
>>
>>  <rng:define name="docAuthor">
>>    <rng:element name="docAuthor">
>>      <rng:ref name="macro.phraseSeq"/>
>>      <rng:ref name="docAuthor.attributes"/>
>>    </rng:element>
>>  </rng:define>
>>
>>where macro.phraseSeq is
>>
>>  <rng:define name="macro.phraseSeq">
>>    <rng:zeroOrMore>
>>      <rng:ref name="macro.phrasegroup"/>
>>    </rng:zeroOrMore>
>>  </rng:define>
>>
>>
>>This translate with trang into
>>
>>  <xsd:element name="docAuthor">
>>    <xsd:complexType>
>>      <xsd:complexContent>
>>        <xsd:extension base="ns1:macro.phraseSeq">
>>          <xsd:attributeGroup ref="ns1:docAuthor.attributes"/>
>>        </xsd:extension>
>>      </xsd:complexContent>
>>    </xsd:complexType>
>>  </xsd:element>
>>
>>and
>>
>>  <xsd:complexType name="macro.phraseSeq" mixed="true">
>>    <xsd:group minOccurs="0" maxOccurs="unbounded" 
>>ref="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='true'".
>>
>>Can anyone explain to me
>>
>> a) is Microsoft correct?
> 
> 
> With W3C XML Schema, it's always difficult to be sure but here is what I
> have written on the subject a while ago :
> 
> http://lists.w3.org/Archives/Public/xmlschema-dev/2001Oct/0113.html
> 
> 
> Also, http://w3.org/TR/xmlschema-1/#Complex_Type_Definitions says:
> 
> <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
> ·actual value·;
> 1.2 If the mixed [attribute] is present on <complexType>, then its
> ·actual value·;
> 1.3 otherwise false.
> </quote>
> 
> and later on :
> 
> <quote>
> 1.4.3.2.2.1 Both {content type}s must be mixed or both must be
> element-only.
> </quote>
> 
> To make it short, I *think* that on this one, Microsoft is right and
> trang is wrong.
> 
> 
>> b) whether I can fix this in any way, short of writing a transform of
>> the XSD?
> 
> 
> What about trying to isolate a simpler repro case and 
> 
> a) send a mail to James Clark
> b) see if by rewriting the RNG schema you can work around this behavior
> 
> ???
> 
> 
>>yours depressed by Microsoft again
> 
> 
> That's depressing for sure but in that case, I find W3C XML Schema the
> depressing factor, not Microsoft!
> 
> Hope this helps.
> 
> Eric
> 
> 
>>Sebastian
>>



More information about the relaxng-user mailing list