oasis-tcs / lexidma

OASIS Lexicographic Infrastructure Data Model and API (LEXIDMA) TC: A repository designed for use in development of TC chartered work products and test suites. https://github.com/oasis-tcs/lexidma
Other
7 stars 8 forks source link

XSD Schemas invalid? #119

Closed jmccrae closed 3 months ago

jmccrae commented 5 months ago

I tried to use the XSD schemas (with xmllint) and get the following errors

XML/dmlex.xsd:35: element unique: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}unique': The attribute 'ref' is not allowed.
XML/dmlex.xsd:35: element unique: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}unique': The attribute 'name' is required but missing.
XML/dmlex.xsd:195: element assert: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}complexType': The content is not valid. Expected is (annotation?, (simpleContent | complexContent | ((group | all | choice | sequence)?, ((attribute | attributeGroup)*, anyAttribute?)))).
XML/dmlex.xsd:199: element unique: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}unique': The attribute 'ref' is not allowed.
XML/dmlex.xsd:199: element unique: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}unique': The attribute 'name' is required but missing.
XML/dmlex.xsd:207: element unique: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}unique': The attribute 'ref' is not allowed.
XML/dmlex.xsd:207: element unique: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}unique': The attribute 'name' is required but missing.
XML/dmlex.xsd:208: element unique: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}unique': The attribute 'ref' is not allowed.
XML/dmlex.xsd:208: element unique: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}unique': The attribute 'name' is required but missing.
XML/dmlex.xsd:212: element unique: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}unique': The attribute 'ref' is not allowed.
XML/dmlex.xsd:212: element unique: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}unique': The attribute 'name' is required but missing.
XML/dmlex.xsd:229: element unique: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}unique': The attribute 'ref' is not allowed.
XML/dmlex.xsd:229: element unique: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}unique': The attribute 'name' is required but missing.
XML/dmlex.xsd:275: element assert: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}complexType': The content is not valid. Expected is (annotation?, (simpleContent | complexContent | ((group | all | choice | sequence)?, ((attribute | attributeGroup)*, anyAttribute?)))).
XML/dmlex.xsd:285: element unique: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}unique': The attribute 'ref' is not allowed.
XML/dmlex.xsd:285: element unique: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}unique': The attribute 'name' is required but missing.
XML/dmlex.xsd:294: element assert: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}complexType': The content is not valid. Expected is (annotation?, (simpleContent | complexContent | ((group | all | choice | sequence)?, ((attribute | attributeGroup)*, anyAttribute?)))).
XML/dmlex.xsd:313: element unique: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}unique': The attribute 'ref' is not allowed.
XML/dmlex.xsd:313: element unique: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}unique': The attribute 'name' is required but missing.
XML/dmlex.xsd:345: element assert: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}complexType': The content is not valid. Expected is (annotation?, (simpleContent | complexContent | ((group | all | choice | sequence)?, ((attribute | attributeGroup)*, anyAttribute?)))).
XML/dmlex.xsd:355: element unique: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}unique': The attribute 'ref' is not allowed.
XML/dmlex.xsd:355: element unique: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}unique': The attribute 'name' is required but missing.
XML/dmlex.xsd:356: element unique: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}unique': The attribute 'ref' is not allowed.
XML/dmlex.xsd:356: element unique: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}unique': The attribute 'name' is required but missing.
XML/dmlex.xsd:357: element unique: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}unique': The attribute 'ref' is not allowed.
XML/dmlex.xsd:357: element unique: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}unique': The attribute 'name' is required but missing.
XML/dmlex.xsd:358: element unique: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}unique': The attribute 'ref' is not allowed.
XML/dmlex.xsd:358: element unique: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}unique': The attribute 'name' is required but missing.
XML/dmlex.xsd:379: element assert: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}complexType': The content is not valid. Expected is (annotation?, (simpleContent | complexContent | ((group | all | choice | sequence)?, ((attribute | attributeGroup)*, anyAttribute?)))).
XML/dmlex.xsd:389: element assert: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}extension': The content is not valid. Expected is (annotation?, ((attribute | attributeGroup)*, anyAttribute?)).
XML/dmlex.xsd:395: element unique: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}unique': The attribute 'ref' is not allowed.
XML/dmlex.xsd:395: element unique: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}unique': The attribute 'name' is required but missing.
XML/dmlex.xsd:396: element unique: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}unique': The attribute 'ref' is not allowed.
XML/dmlex.xsd:396: element unique: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}unique': The attribute 'name' is required but missing.
XML/dmlex.xsd:413: element assert: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}complexType': The content is not valid. Expected is (annotation?, (simpleContent | complexContent | ((group | all | choice | sequence)?, ((attribute | attributeGroup)*, anyAttribute?)))).
XML/dmlex.xsd:426: element assert: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}complexType': The content is not valid. Expected is (annotation?, (simpleContent | complexContent | ((group | all | choice | sequence)?, ((attribute | attributeGroup)*, anyAttribute?)))).
XML/dmlex.xsd:456: element unique: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}unique': The attribute 'ref' is not allowed.
XML/dmlex.xsd:456: element unique: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}unique': The attribute 'name' is required but missing.
XML/dmlex.xsd:470: element unique: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}unique': The attribute 'ref' is not allowed.
XML/dmlex.xsd:470: element unique: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}unique': The attribute 'name' is required but missing.
XML/dmlex.xsd:482: element unique: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}unique': The attribute 'ref' is not allowed.
XML/dmlex.xsd:482: element unique: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}unique': The attribute 'name' is required but missing.
XML/dmlex.xsd:534: element unique: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}unique': The attribute 'ref' is not allowed.
XML/dmlex.xsd:534: element unique: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}unique': The attribute 'name' is required but missing.
XML/dmlex.xsd:561: element unique: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}unique': The attribute 'ref' is not allowed.
XML/dmlex.xsd:561: element unique: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}unique': The attribute 'name' is required but missing.
XML/dmlex.xsd:597: element unique: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}unique': The attribute 'ref' is not allowed.
XML/dmlex.xsd:597: element unique: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}unique': The attribute 'name' is required but missing.
XML/dmlex.xsd:644: element unique: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}unique': The attribute 'ref' is not allowed.
XML/dmlex.xsd:644: element unique: Schemas parser error : Element '{http://www.w3.org/2001/XMLSchema}unique': The attribute 'name' is required but missing.
WXS schema XML/dmlex.xsd failed to compile

Running with the Python xmlschema library creates similar issues (see reproduction here: https://colab.research.google.com/drive/1EDLou3j5BgbFOCMhIpEv6KQIwJCGlUUX?usp=sharing)

The definitions of XSD here seems to agree with xmllint

Do we need to rollback #113?

michmech commented 5 months ago

Related to #93.

blahma commented 4 months ago

Hello. The schemas seem to be fine. It is the documents being validated which cause errors. I have made changes in the shared Colab to fix the errors encountered: Error #1: lexicographicResource is not an element of the schema was caused by the top element not being in the correct namespace. I changed it by adding xmlns="http://docs.oasis-open.org/lexidma/ns/dmlex-1.0" to it. I am not sure if this is the proper and only possible way, but it works. After fixing that and recompiling, I got: Error #2: Unexpected child with tag title This is because you have used an outdated example XML file in which title is still an element and not an attribute. This has been fixed in commit 88937b3b0cd0dde443e14d8ef3c0211ffc937c5d After changing the XML file, I got: Error #3: The content of element lexicographicResource is not complete. Tag translationLanguage expected. This is expected behavior, because the XSD schema you have used is the one which implements all modules, including crossLingual. Because the XML file does not actually have any cross-lingual data, validation fails (because at least one translationLanguage is required for cross-lingual data). If you replace the current XSD schema with the dmlex_no-crosslingual.xsd, the document should validate (I have not done that in the Colab).

jmccrae commented 4 months ago

Okay I see

mjakubicek commented 4 months ago

We are working towards integrating this into the CI #120, so it will be more visible then what needs to be done in order to validate the examples. We can review this afterwards.