Open MarcusVonBergen opened 1 month ago
Thanks, @MarcusVonBergen ! @s-heppner can you please double-check, maybe also with other teams?
All the XSD engines I tested with (Python, C#) worked with the current schema.
Hi @MarcusVonBergen, can you please tell me which XSD validator you used so that I can try to reproduce the issue?
I do not know but perhaps this is also related to https://github.com/admin-shell-io/aas-test-engines/issues/43? I also get an error when validating an xml file with the test engine
I do not think this is connected to admin-shell-io/aas-test-engines#43, since it seems that the XML schema check passes on these files.
Hi @MarcusVonBergen, can you please tell me which XSD validator you used so that I can try to reproduce the issue?
We are using, for instance, https://www.freeformatter.com/xml-validator-xsd.html and the Visual Studio Code "XML" extension from Red Hat.
Hi everyone, thank you for your quick answers and sorry for my late one. I used an online validator as well as a validation tool that is part of the SAP Integration Suite which builds on top of Apache Camel. Both listed me the same error stating that it cannot find the declaration of the element 'environment' from line 1. To reproduce the issue do the following:
Take the AAS XML (I used a v2.0 Bosch example saved it with the AAS Package Explorer to leverage it to v3.0 and resolved the idshort convention changes from v2.0 to v3.0): AAS.xml.txt
This is one of the tools I used to validate the XSD: https://www.freeformatter.com/xml-validator-xsd.html
This XSD (currently on GitHub) leads to the error: AAS.xsd.txt
This is the modified XSD that defines the environment tag as xs:element. Using this the validation succeeds: AAS_new.xsd.txt
I hope I could resolve unclarities. Kind regards Marcus
I can confirm that there are XML Schema validators that need the root of an XSD to be an xs:element
.
This shouldn't break any other XML Schema validators, as it is valid XSD.
Therefore, I've adapted the XSD Schema file to include an xs:element
definition of aas:environment
in this PR: #464.
@MarcusVonBergen could you please see if the new XSD schema fixes the problems you have?
When validating v3.0 AAS XML files against AAS.xsd I get the error that the tag environment is not declared. Digging deeper the error is occurring because in the schema file (XSD), the tag "environment" is defined as an "xs:group" instead of "xs:element" which is supposed to be root. The root element of an XML document should always be defined as an "xs:element" in the XSD file like this in our example:
<xs:element name="environment">
Changing the XSD accordingly resolves my validation errors. I attached the new XSD file (as txt as GitHub does not support xsd) with the ask to adjust the changes in the project. AAS_xsd.txt