Hi Nacho and all,
First of all, Thanks very much for your so wide help. I was thinking that the problem was around that recursion example, but i'm not very used to XML Schema syntax.
Let me explain a little bit about this XML Schema: I'm developing some application based on media content and preferences description in XML. I need to marshall/unmarshall from/to XML to/from Java classes to show and insert the descriptions into forms and into a XML Native Database (Xindice). In my investigations I found the TVAnytime Forum (http://www.tv-anytime.org/), "an association of organizations which seeks to develop specifications to enable audio-visual and other services based on mass-market high volume digital storage in consumer platforms - simply referred to as local storage". So, I looked for Metadata Specifications and I found they make public these XML Schemas. So, I think of course you can use this example since it is public :).
After this, i'm wondering ... Does TVAnytime give, let me say, "non-valid" XML Schema because of that "problem" of recursivity? Or the isomorphic XML Schema you explain me is "TVAnytime Specifications-compliant"?
Secondly, I have found that JaxMe does not support "gYear" type... doesn't it?
Thanks again for everything,
Carol ------------- Carolina Anton <[EMAIL PROTECTED]> <[EMAIL PROTECTED]>
Nacho G. Mac Dowell wrote:
Hi Carolina, I was taking a look at mpeg7_tva.xsd and I can see a potential problem for a proper binding and this is a recursion problem. Lets take a closer look to TermDefinitionType (which apparently is causing the problem):
<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]
