Either of the first two cases are permissible, but the latter case is not. Is it possible to create a xsd for this xml, or is it invalid?
<book id="something" />
<!-- or -->
<book>something</book>
<!--not -->
<
<book id="something">
something else
</book>
EDIT: Here's the schema I was attempting to use - I'm still very new to xml, so I can't promise it's close to being right...
<xs:simpleType name="book">
<xs:restriction base="xs:string">
</xs:restriction>
</xs:simpleType>
<xs:complexType name="book2">
<xs:simpleContent>
<xs:extension base="or:book">
<xs:attribute name="id" type="xs:string" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:complexType name="book3">
<xs:simpleContent>
<xs:restriction base="or:book2">
<xs:maxLength value="0" />
</xs:restriction>
</xs:simpleContent>
</xs:complexType>
<xs:element name="root">
<xs:complexType>
<xs:choice>
<xs:element name="book" maxOccurs="unbounded" type="or:book" />
<xs:element name="book" maxOccurs="unbounded" type="or:book3" />
</xs:choice>
</xs:complexType>
</xs:element>