RE: Element + complextype name in xml schema

It's not allowed.

The complex type under the element has to be an anonymous type [1]:

<element>s within <schema> produce global element declarations;
<element>s within <group> or <complexType> produce either particles
which contain global element declarations (if there's a ref attribute)
or local declarations (otherwise). For complete declarations, top-level
or local, the type attribute is used when the declaration can use a
built-in or pre-declared type definition. Otherwise an anonymous
<simpleType> or <complexType> is provided inline.


http://www.w3.org/TR/2004/PER-xmlschema-1-20040318/structures-with-errat
a.html#declare-element



-----Original Message-----
From: xmlschema-dev-request@w3.org [mailto:xmlschema-dev-request@w3.org]
On Behalf Of Nicolas Mailhot
Sent: Friday, April 08, 2005 7:58 AM
To: xmlschema-dev@w3.org
Subject: Element + complextype name in xml schema


Hi,

I've been sent an xsd that uses the following construct :

<xsi:element name="foo">
  <xsi:complexType name="foo">

Is this something allowed ? I couldn't find anything that said it's
wrong, but at the same time I have an xml parser that chokes on it and
none of the public xsd examples I've ever seen used it. I'd like to
know if I should file a bug on the parser or if I can tell the people
that send me the schema their definition does not fly.

I've little experience on xml schemas so far though it looks like I'm
up for an accelerated course.

Regards,

-- 
Nicolas Mailhot

Received on Friday, 8 April 2005 18:21:13 UTC