Closed guusdk closed 1 year ago
Hi @guusdk
I looked at your schemas and they seem to contain issues as far as I can tell. I used Oxygen to validate them but other IDEs or Xerces library might report the same issues (see below, where it mentions also the lines)
I assume that's why processing the schemas fails.
System-ID: ...\resources\xsf\streams.xsd Haupt-Validierungsdatei: ...\resources\xsf\defaultSchema.xsd Programmname: Xerces Fehlerlevel: error Beschreibung: cos-nonambig: "jabber:server":iq and WC[##other:"http://etherx.jabber.org/streams",""] (or elements from their substitution group) violate "Unique Particle Attribution". During validation against this schema, ambiguity would be created for those two particles. Start: 24:6 End: 24:20 URL: http://www.w3.org/TR/xmlschema-1/#cos-nonambig
System-ID: ...\resources\xsf\streams.xsd Haupt-Validierungsdatei: ...\resources\xsf\defaultSchema.xsd Programmname: Xerces Fehlerlevel: error Beschreibung: cos-nonambig: "urn:ietf:params:xml:ns:xmpp-streams":text and WC[##other:"http://etherx.jabber.org/streams",""] (or elements from their substitution group) violate "Unique Particle Attribution". During validation against this schema, ambiguity would be created for those two particles. Start: 75:6 End: 75:20 URL: http://www.w3.org/TR/xmlschema-1/#cos-nonambig
Thank you for your fast response. You are correct. Apparently, this problem in the schema was identified long ago: https://xmpp.org/extensions/xep-0322.html#patch
With the patch from that text applied, the assertion is no longer triggered.
When creating grammar from a set of XSDs provided by the XMPP Standards Foundation,
com.siemens.ct.exi.grammars.EXIContentModelBuilder.handleStateEntries()
throws an AssertionError (when assertions are enabled in the VM), with the latest state of the code (v1.0.4 and 1.0.5-SNAPSHOT).This PR adds a unit test that reproduces this behavior.
The assertion that fails is: https://github.com/EXIficient/exificient-grammars/blob/77413b7978c2b6fa4a97ab0c3debb16f12d2712f/src/main/java/com/siemens/ct/exi/grammars/EXIContentModelBuilder.java#L378
The stack trace for the error is:
I am unsure if this is a problem in Exificient, the XSDs that are used, or the test setup. However, I am unable to progress further on this issue, and am looking for feedback from more capable eyes.