Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Problem with types derived from mixed complex types

From: ht@---.--.--.-- (----- -. --------)
To: Tait E Larson <telarson@--.---.--->
Date: 6/5/2004 12:09:00 PM
Tait E Larson <telarson@u...> writes:

>       <xs:complexType name="BASE" mixed="true">
>             <xs:sequence>
>                   <xs:element name="elemA" type="xs:integer" />
>             </xs:sequence>
>             <xs:attribute name="attrB" type="xs:string" />
>       </xs:complexType>

> I get the following error when I try to validate this schema or the sch=
ema
> you provided:
>
>
> src-ct.2: Complex Type Definition Representation Error for type 'SUB'.
> When simpleContent is used, the base type must be a complexType whose
> content type is simple, or, only if extension is      specified, a simp=
le
> type.

That error message is wrong, as Michael correctly pointed out by
reference to the revised REC.  But your example is _still_ not valid,
because your complex BASE is not *emptiable*.

The uncorrected REC contained a contradiction between clause 5.1.2 of
Derivation Valid (Restriction, Complex) [1] which said (and still
says, although it's now numbered as 5.2.2.2) if a complex type
definition derived from a base with complex has simple content:

  "The {base type definition} must be mixed and have a particle which
  is =B7emptiable=B7 as defined in Particle Emptiable (=A73.9.6)."

So if elemA had minOccurs="0" you'd be OK.

The problem in the uncorrected REC was that it _also_ said, in the
definition of the mapping from schema documents to components for
Complex Type Definition[s] with simple content [2]:

  "if the type definition =B7resolved=B7 to by the =B7actual value=B7 of =
the
  base [attribute] is a complex type definition (whose own {content
  type} _must be a simple type definition, see below_) and the
  <restriction> alternative is chosen," [emphasis added]

This evidently contradicts the first quote.  The W3C XML Schema WG
decided to resolve the contradiction in favour of _allowing_ such
derivations.  Accordingly, E1-27 in the errata document [3] and the
Proposed Edited Recommendation [4] change the _second_ passage quoted
above and add an extra mapping clause to cover the relevant case:

  "1. If the type definition =B7resolved=B7 to by the =B7actual value=B7 =
of
  the base [attribute] is a complex type definition whose own {content
  type} is a simple type definition and the <restriction> alternative
  is chosen, . . .

  "2. If the type definition =B7resolved=B7 to by the =B7actual value=B7 =
of
  the base [attribute] is a complex type definition whose own {content
  type} is mixed and a particle which is =B7emptiable=B7, as defined in
  Particle Emptiable (=A73.9.6) and the <restriction> alternative is
  chosen, . . ."

Hope this helps clear things up,

ht

[1] http://www.w3.org/TR/xmlschema-1/#derivation-ok-restriction
[2] http://www.w3.org/TR/xmlschema-1/#Complex_Type_Definition_details
[3] http://www.w3.org/2001/05/xmlschema-errata.html#e1-27
[4] http://www.w3.org/TR/2004/PER-xmlschema-1-20040318/#Complex_Type_Defi=
nition_details
-- 
 Henry S. Thompson, HCRC Language Technology Group, University of Edinbur=
gh
                     Half-time member of W3C Team
    2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
            Fax: (44) 131 650-4587, e-mail: ht@i...
                   URL: http://www.ltg.ed.ac.uk/~ht/
[mail really from me _always_ has this .sig -- mail without it is forged =
spam]

From ht@i...  Sat Jun  5 13:31:16 2004
Return-Path: <ht@i...>
X-Original-To: xmlschema-dev@l...


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