Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: mixed attribute on complexType/complexContent

From: Kasimier Buchcik <kbuchcik@---------.-->
To: Michael Kay <mike@--------.--->
Date: 12/13/2004 12:42:00 PM
Hi,

Michael Kay wrote:
> In 3.4.2 teh mapping table for complex content shows:
> 
> {content type}	
> 1 [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.
> 
> In 3.4.3, Constraints on XML Representations of Complex Type Definitions,
> there doesn't seem to be a rule prohibiting <complexType mixed="true"> with
> <complexType mixed="false">, or vice versa.

Hmm, it seems that the complexContent/simpleContent overrides the
complexType regarding the 'mixed' value. The reason might be that the
'mixed' on complexType was invented only to allow setting it if using
the shorthand form of complexContent, i.e. not specifying the
complexContent at all.

> Does this mean that if the mixed attribute is present on complexContent, the
> value of the mixed attribute on complexType is ignored, and no error occurs
> if they are inconsistent?

It's a 'no effect' attribute in this case, comparable to:

3.4.3 (2.2)
"... specifying <xs:complexType . . .mixed='true' when the
<simpleContent> alternative is chosen has no effect on the corresponding
component, and should be avoided. This may be ruled out in a subsequent 
version of this specification."

To it seems not clear - maby except for historical reasons - why 'mixed'
should not be hold by the complexType _only_.

I tried to test this against XSV and Xerces:

Schema:
------
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
   <xsd:element name="foo">
     <xsd:complexType mixed="true">
       <xsd:complexContent mixed="false">
         <xsd:restriction base="xsd:anyType">
           <xsd:sequence>
             <xsd:element name="bar"/>
           </xsd:sequence>
         </xsd:restriction>
       </xsd:complexContent>
     </xsd:complexType>
   </xsd:element>
</xsd:schema>

Instance:
---------
<foo>
   hi
   <bar/>
</foo>

XSV 2.7-1 and Xerces-J 2.6.2 both don't like the character content if
'mixed' was enabled on complexType and disabled on complexContent.
With...

  <xsd:complexType mixed="false">
       <xsd:complexContent mixed="true">

...both seem to be happy.

Regards,

Kasimier


From george@o... Mon Dec 13 11:28:43 2004
Received: from lisa.w3.org ([128.30.52.41])
	by frink.w3.org with esmtp


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