Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: Empty complexType with mixed="true"

From: "Shlomo Yona" <S.Yona@--.--->
To: "Andrew Welch" <andrew.j.welch@-----.--->, <xmlschema-dev@--.--->
Date: 3/17/2008 9:28:00 PM
Hello,

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

Shlomo.

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

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/




transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent