Altova Mailing List Archives>Archive Index >xmlschema-dev Archive Home >Recent entries >Thread Prev - RE: Empty complexType with mixed="true" >Thread Next - RE: Empty complexType with mixed="true" Re: Empty complexType with mixed="true"To: xmlschema-dev@--.--- Date: 3/18/2008 11:19:00 AM
On 18/03/2008, Michael Kay <mike@s...> wrote:
> If a complex type is empty, then no child elements are allowed. But if the
> mixed=true, then you are still allowed text nodes, comments, and processing
> instructions as children;
What's the best way to model "element with text content and
attributes"? For example:
<foo bar="b" baz="b"> only text allowed </foo>
I've used this before, but it seems bulky:
<xs:complexType name="foo">
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="bar" type="xs:string"/>
<xs:attribute name="baz" type="xs:string"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
This thread has suggested you can do this:
<xs:complexType name="foo" mixed="true">
<xs:attribute name="bar" type="xs:string"/>
<xs:attribute name="baz" type="xs:string"/>
</xs:complexType>
Is that right? If so, is that shorthand for the above?
thanks
--
Andrew Welch
http://andrewjwelch.com
Kernow: http://kernowforsaxon.sf.net/
From S.Yona@F... Tue Mar 18 11:29:02 2008
Received: from lisa.w3.org ([128.30.52.41 | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
