Hi Ray,
you are right in your assumption - the XML Schema spec defines rules (
http://www.w3.org/TR/xmlschema-1/#Complex_Type_Definition_details,
3.4.2. ) which do not allow any other interpretation: just as if the
type were xs:string, any character content is valid, and no child
elements are allowed.
In the example case you showed, where the type definition is local
(anonymous), empty mixed amounts to an eccentric way of saying
type="xs:string". However, if the type definition is global and has a
name, such an empty mixed type makes sense, because it can be used as
base type for type derivations which are not possible if the base type
is xs:string.
Namely, the empty mixed is a complex type and can therefore be extended
by adding child elements, and it can also be restricted to a simple type
which is not derived from xs:string. Both things are not possible if the
base type is xs:string, which is a simple type and can only be
restricted to subtypes of xs:string, or extended to a type with
xs:string content plus attributes.
With kind regards,
Hans-Juergen Rennau
*Date:* Mon, 22 Feb 2010 11:19:38 -0500
*Reply-To:* "SRU (Search and Retrieve Via URL) Implementors"
<[log in to unmask] <http://listserv.loc.gov/cgi-bin/wa?LOGON=A2%3Dind1002%26L%3Dzng%26T%3D0%26P%3D1514>>
*Sender:* "SRU (Search and Retrieve Via URL) Implementors"
<[log in to unmask] <http://listserv.loc.gov/cgi-bin/wa?LOGON=A2%3Dind1002%26L%3Dzng%26T%3D0%26P%3D1514>>
*From:* "Ray Denenberg, Library of Congress" <[log in to unmask] <http://listserv.loc.gov/cgi-bin/wa?LOGON=A2%3Dind1002%26L%3Dzng%26T%3D0%26P%3D1514>>
*Subject:* Explain schema question
*Comments:* To: "SRU (Search and Retrieve Via URL) Implementors" <[log in to unmask] <http://listserv.loc.gov/cgi-bin/wa?LOGON=A2%3Dind1002%26L%3Dzng%26T%3D0%26P%3D1514>>
*Content-Type:* text/plain; format=flowed; charset="iso-8859-1";
reply-type=original
In the OASIS committee working on SRU 2.0 we are in the process now of
taking a critical look at Explain and we have a technical question about
the schema. Perhaps one of you Explain implementors might have some
insight. (There no longer seems to be anyone claiming ownership of
Explain, and if nobody steps forward, I am going to claim ownership, on
behalf of the SRU maintenance agency, within the next few weeks.) Our
question is this There are several datatypes whose definitions look like
this: <xs:element name='host'> <xs:complexType mixed='true'>
</xs:complexType> </xs:element> What does it mean? How would it differ
from: <xs:element name='host' type = "xs:string"> We know what
mixed='true' means, if for example, you had <xs:element name='host'>
<xs:complexType mixed='true'> <xs:sequence> <xs:element name="a"/>
<xs:element name="b"/> </xs:sequence> </xs:complexType> </xs:element>
Then you could have an instance of element <host> that would look like:
<host> (text preceding element a) <a>(content of element a) </a> (text
between elements a and b) <b>(content of element b)</b> (text following
element b) </host> In other words, mixed content and elements, which
would not be allowed without mixed="true" But what does the first mean?
The complex definition does not define any elements, and it seems to us
that it degenerates to nothing more than a string. Nothing else makes
any sense. Anyone have any other interpretations? Thanks. --Ray
|