W3C home > Mailing lists > Public > xmlschema-dev@w3.org > February 2005

Re: Inadvertently restricting mixed content

From: Dan Vint <dvint@dvint.com>
Date: Thu, 03 Feb 2005 12:29:50 -0800
Message-Id: <6.1.0.6.2.20050203122641.0312f328@mail.dvint.com>
To: xmlschema-dev@w3.org

I would expect the effect to be different depending upon the use of 
extension or restriction. With extension it should automatically be 
whatever the original definition was, not a new default of false.

For restriction, I could see requiring that you get the declaration 
correct, but a default is not appropriate here either. My logic here is 
that restriction requires me to replicate most of the original content 
model anyway, I would expect the "mixed" attribute to be included in that 
process.

..dan

At 11:45 AM 2/3/2005, G. Ken Holman wrote:

>It appears that one cannot redefine a type and leave the mixed= nature of 
>the original type untouched, which would be important if it were not known 
>or, more important, arbitrary.
>
>Looking at Part 1, Section 3.4.2, mixed= on <xsd:complexType> has a 
>default value of false.
>
>Consider I might have a type with mixed content:
>
>    <xsd:complexType name="abcType" mixed="true">
>      <xsd:attribute ...>
>      ...
>
>Now, I redefine that type in an importing schema fragment:
>
>    <xsd:redefine ...>
>      <xsd:complexType name="abcType">
>         <xsd:complexContent>
>            <xsd:extension base="abcType">
>               ...
>
>The standard states there is an implicit mixed="false" because of the 
>default value.  This turns off my mixed content, when all I wanted to do 
>was extend the existing type with some elements.
>
>In this case I know I can just add mixed="true" in the redefinition to 
>ensure the content is mixed ... but am I missing a way in which I can 
>redefine a type while preserving its mixed= property?
>
>My guess is no, because if I wanted to turn off the mixed content property 
>I would intuitively say mixed="false" ... but my intuition to leave it 
>unchanged is to leave the attribute absent ... but when absent the default 
>value forces the redefinition to not be mixed.  So, it appears I have to 
>know a priori that a given type I'm redefining is mixed or not and the 
>burden is on me to preserve it.
>
>Have I read anything incorrectly in this regard?
>
>Thanks for any guidance.
>
>............................... Ken
>
>--
>World-wide on-site corporate, govt. & user group XML/XSL training.
>G. Ken Holman                 mailto:gkholman@CraneSoftwrights.com
>Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/x/
>Box 266, Kars, Ontario CANADA K0A-2E0    +1(613)489-0999 (F:-0995)
>Male Breast Cancer Awareness  http://www.CraneSoftwrights.com/x/bc
>Legal business disclaimers:  http://www.CraneSoftwrights.com/legal
>

---------------------------------------------------------------------------
Danny Vint

Specializing in Panoramic Images of California and the West
http://www.dvint.com

voice: 510-522-4703
fax: 801-749-3229


     
Received on Thursday, 3 February 2005 20:26:32 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:49 GMT