W3C home > Mailing lists > Public > xmlschema-dev@w3.org > March 2008

RE: Empty complexType with mixed="true"

From: Shlomo Yona <S.Yona@F5.com>
Date: Tue, 18 Mar 2008 04:27:48 -0700
Message-ID: <AB313AF70F994447A667F4D942CA655717BAB583@excheight.olympus.f5net.com>
To: "Andrew Welch" <andrew.j.welch@gmail.com>, <xmlschema-dev@w3.org>

In the case of mixed="true" I don't think that the text is of type xsd:string.


-----Original Message-----
From: xmlschema-dev-request@w3.org on behalf of Andrew Welch
Sent: Tue 3/18/2008 1:19 PM
To: xmlschema-dev@w3.org
Subject: Re: Empty complexType with mixed="true"

On 18/03/2008, Michael Kay <mike@saxonica.com> 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:extension base="xs:string">
            <xs:attribute name="bar" type="xs:string"/>
            <xs:attribute name="baz" type="xs:string"/>

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"/>

Is that right?   If so, is that shorthand for the above?

Andrew Welch
Kernow: http://kernowforsaxon.sf.net/
Received on Tuesday, 18 March 2008 11:29:02 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:56:14 UTC