<complexType name="TermDefinitionType">
<complexContent>
<extension base="mpeg7:TermDefinitionBaseType">
<sequence>
<element name="Term" minOccurs="0" maxOccurs="unbounded">
<complexType>
<complexContent>
<extension base="mpeg7:TermDefinitionType">
<attribute name="relation" type="mpeg7:termRelationQualifierType" use="optional" default="NT"/>
</extension>
</complexContent>
</complexType>
</element>
</sequence>
</extension>
</complexContent>
</complexType>
The schema is extending a recursive element before it is actually processed. Although this is a correct schema, from a binding perspective it seems to me as a dead-end. We could "translate" this schema to an equivalent one like this:
<complexType name="TermDefinitionType">
<complexContent>
<extension base="mpeg7:TermDefinitionBaseType">
<sequence>
<element name="Term" minOccurs="0" maxOccurs="unbounded" type="mpeg7:TermDefinitionTypeNode">
</element>
</sequence>
</extension>
</complexContent>
</complexType>
<complexType name="TermDefinitionTypeNode">
<complexContent>
<extension base="mpeg7:TermDefinitionBaseType">
<attribute name="relation" type="mpeg7:termRelationQualifierType" use="optional" default="NT" />
</extension>
</complexContent>
</complexType>
This definition would validate any xml that validated the former. Further investigation would be required to have a valid proof, but I think it is clear enough that it would produce the same xml. I found very interesting taking a look at this schema and I wanted to ask you if I can post a question in the w3c mailing list with this example. IMHO recursion-limits are not well defined in xml-schema. The schema specification just states a couple of restrictions to recursion which I find insufficient.
I remember when recursion was developped for JaxMe the following comment arised:
Here we are! The bad news is that IMHO the schema provided would be very hard (impossible?) to bind. The good news is that there will always be an isomorphic schema. So, to the point now: The schema will now compile with another change: anyType doesn't seem to be well supported (Jochen?). There is another workaround for this: just eliminate the restriction and it will support anyType (strange enough). So where you've got:If the child is of the same type, but has been extended: what would happen?
Good question, which i delegate for later. ;-)
<complexType name="Mpeg7BaseType" abstract="true">
<complexContent>
<restriction base="anyType" />
</complexContent>
</complexType>just type: <complexType name="Mpeg7BaseType" abstract="true"/> which is semantically identical (as far as I know anyType is the default type for a complexType).
Now your schema compiles! You have to be aware though that there is no root element so no xml document will conform to this schema.
An obviest drawback of all this is that the schema you are using seems to be a public one... so you may dislike "adapting it for JaxMe".
Regards,
Nacho
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
