Open jflevesque-genetec opened 10 months ago
The error message is a validation error that occurs when compiling the XML schema using XmlSchemaSet.Compile()
.
Though the error message is pretty cryptic, I think what it means is that it's impossible to validate a document against the schema because of this part:
<xs:complexType name="ColorDescriptor">
<xs:sequence>
<xs:element name="ColorCluster" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="Color" type="tt:Color"/>
<xs:element name="Weight" type="xs:float" minOccurs="0"/>
<xs:element name="Covariance" type="tt:ColorCovariance" minOccurs="0"/>
<xs:any namespace="##any" processContents="lax" minOccurs="0" maxOccurs="unbounded"/> <!-- reserved for ONVIF -->
</xs:sequence>
<xs:anyAttribute processContents="lax"/>
</xs:complexType>
</xs:element>
<xs:element name="Extension" type="xs:anyType" minOccurs="0"/>
<xs:any namespace="##any" processContents="lax" minOccurs="0" maxOccurs="unbounded"/> <!-- reserved for ONVIF -->
</xs:sequence>
<xs:anyAttribute processContents="lax"/>
</xs:complexType>
Weight
occurs after Color
, is it the explicit Weight
element or were both Weight
and Covariance
omitted (minOccurs="0"
) and it's part of the any
?Extension
occurs, is it the explicit element or was that omitted and it's part of the any
?If you remove both of the above lines containing xs:any
(lines 224 and 230) it will generate code. However, I'm not sure if this would allow all real life documents to deserialize.
Another way to fix the schema is to set minOccurs="1"
for Covariance
and Extension
. Again, not sure what real life documents will look like for your use case and if they can be deserialized with this modification to the schema.
Third option I can think of is to make the owners of the schema aware of this ambiguity and have them fix it. Not sure if that's feasible of course. The organization that publishes the schema has a GitHub account https://github.com/onvif/ but I haven't investigated further if they accept issue reports in the schemas they publish.
Hi,
First time user of this generator and I'm getting these warnings that seem to prevent the code gen from completing. I am currently trying to understand how I should modify the XSD file to resolve these issues.
Generates these logs:
Any ideas?
common.xsd can be found here: https://www.onvif.org/ver10/schema/common.xsd