Altova Mailing List Archives>Archive Index >xmlschema-dev Archive Home >Recent entries >Thread Prev - RE: Problem with types derived from mixed complex types [Thread Next] Re: Problem with types derived from mixed complex typesTo: 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... | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
