PDA

View Full Version : QXMLSchema Circular References



Poonarge
13th June 2014, 09:33
Hi,

I'm currently working with the Amazon MWS API, but having trouble with the amzn-envelope.xsd due to there being circular references. I have looked to find ways around this, but to no avail. The only way I've found would be to make local copies of the schema's and remove the includes myself, as stated here (http://stackoverflow.com/questions/17297302/amazon-xml-failing-validation-using-schema-with-multiple-inclusions-of-same-sche), which I don't want to have to do.

So, I was wondering if there is any way to handle this in Qt? A way to ignore circular references, or a way to work around it?


QUrl url("https://images-na.ssl-images-amazon.com/images/G/01/rainier/help/xsd/release_1_9/amzn-envelope.xsd");
QXmlSchema schema;
schema.load(url);

Thanks,

Richard

anda_skoa
13th June 2014, 12:03
Just curious, what do you need the schema for?

Cheers,
_

Poonarge
13th June 2014, 15:52
to validate my xml before posting request to amazon

anda_skoa
13th June 2014, 17:20
Ah, I see, so for testing the correct encoding/escaping of runtime generated data.

I've only ever used schemas to test the XML generation and that is done as part of continuous integration testing and not at runtime :)

Would be interesting to research if circular includes are allowed and if that is an omission in Qt's validator implementation, or if the schemas are actually not valid schemas.

Cheers,
_