Hi Carlos
indeed, there are two different schema validators:
-
a Java-based schema validator used inside the schema editor
(sorry, I do not know which one it is)
It is used in
Tools > Validate XML Schema
-
a schema validator inside the Tamino server
It is used in
Database > Validate TSD Schema…
and
Database > Define Schema…
This issue illustrates that the two validators are not
completely consistent. Below, you’ll see, that 1) contains
some flaws…
The reported error is well-founded for the following reasons:
-
the complexType “ST” is derived by restriction from “ED”
hence every particle in “ST” must be a valid restriction of
a particle in “ED”
-
when looking at element “thumbnail” declared in both types
you’ll find
(ED)
<xsd:element name = “thumbnail” type = “thumbnail”
minOccurs = “0”></xsd:element>
(ST)
<xsd:element name = “thumbnail” type = “ED”
minOccurs = “0” maxOccurs = “0”></xsd:element>
Cardinality-wise, thumbnail(ST) is a valid restriction of thumbnail(ED),
but the type “thumbnail” used in thumbnail(ED) is a restriction if “ED”
being used in thumbnail(ST). As of the XML schema constraint, just the
opposite constraint should be fulfilled.
Once you change the type of thumbnail(ST) to “thumbnail” (effectively this
does not change the schema, as the maxOccurs of thumbnail(ST) is 0),
you’ll run into another error. The definitions for the complex types
“CD” and “CE” contain a flaw, as “CE” which is derived by restriction
from “CD” uses a different order of elements “originalText” and
“qualifier” in a sequence:
<xsd:complexType name = “CD”>
…
<xsd:element name = “originalText” …
<xsd:element name = “qualifier” …
<xsd:element name = “translation” …
<xsd:complexType name = “CE”>
xsd:complexContent
<xsd:restriction base = “CD”>
xsd:sequence
<xsd:element name = “qualifier” …
<xsd:element name = “originalText” …
<xsd:element name = “translation” …
</xsd:sequence>
Once, this is aligned, the Tamino server will accept the schema without
any problem. I have attached the corrected schema.
Best regards
Uli
fixed_datatypes-base.xsd (38.4 KB)
#API-Management#webMethods#Tamino