PDA

View Full Version : xsd validation, xs:include missing ?



Kouillo
4th April 2012, 10:58
Hello.
I'm currently working on a project with small xml databases.

I wrote XSD schemas and XML example files. For convenience, I used a common XML file where I put some common types
I validate syntax and functionality with Oxygen XML.

I am now trying to validate the XML file, with QXmlSchemaValidator, before reading and loading it.
I looked to the schema Validation example to create my code.

When I try to use

Error XSDError in Unknown location, at line 71, column 88: Type {SPSdb}SPSdb:T_Record of element element cannot be resolved.
It seems that the parser does not execute the include and cannot find the type wrote in it. If I replace the include by the common code, it works !

I found this clue in a comment :
http://labs.qt.nokia.com/2009/07/31/qt-46-with-xml-schema-support/#comment-4567

however the XSLT implementation in Qt is still lacking the include functionality

Can you confirm that the include is not supported ?
Is there any rapid and simple way to deal with or do I need to copy the common file in all XSD files ?

Thanks.

wysota
4th April 2012, 11:26
You can preprocess all the files and execute the include statements yourself, it's quite easy. Then you can feed the result to the XML engine.