|
[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Empty Complex Type; Mixed Content Type
I believe that this is an error and have mailed the editor of the primer
suggesting the following modification
<xsd:element name="internationalPrice">
<xsd:complexType>
<xsd:complexContent>
<xsd:restriction>
<xsd:sequence/>
</xsd:restriction>
</xsd:complexContent>
</xsd:complexType>
</xsd:element>
Which provides an empty element with no attributes. Because of the use of an
anonymous type adding attributes is in fact impossible in this case, a named
type should probably be used instead.
I don't *think* extension would actually be allowed as I believe it is
impossible to extend the urType ( anyType ). However, I am checking this and
will confirm later.
With respect to mixed content the 'mixed' attribute was chosen over a
mixedContent element to allow construction of types like the following
<complexType name='paragraph' mixed='true'>
<choice minOccurs='0' maxOccurs='1' >
<element name='b' type='string' />
<element name='i' type='string' />
</choice>
</complexType>
We didn't want people who just wanted to restrict the urType ( anyType ) to
have to go to the full blown content model for complexType just to get mixed
content.
Hope this helps,
Martin Gudgin
----- Original Message -----
From: <ramesh@e...>
To: <xml-dev@x...>
Sent: Saturday, September 30, 2000 12:30 AM
Subject: Empty Complex Type; Mixed Content Type
> Section 2.5.3 in the XML Schema Part 0: Primer describes how to define an
> empty complex type.
>
> The example uses restriction while adding a couple attributes to the type.
> Is that a typo? I expected to use extension in this case.
>
> I also found <xsd:complexType mixed="true"> a little jarring in the
example
> in section 2.5.2, because I was expecting <xsd:mixedContent> for
consistency
> with <xsd:simpleContent> and <xsd:complexContent>, but this may already
have
> been covered in earlier debates. If that's the case, please disregard this
> comment.
>
> Thanks for clarifying.
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|
|||||||||

Cart








