[xml] No matching global declaration available for the validation root



Hi,
 
I try to use libxml2 to generate an XML file and before creating it, I would like to validate it against an existing schema.
 
If I use the xmlSchemaValidateDoc function to validate my xmlDocPtr (created with xmlNewDoc, xmlNewNode, xmlDocSetRootElement, etc...)
I get this error message (Document is the name of the root element in my XML document) :

element Document: Schemas validity error : Element 'Document': No matching global declaration available for the validation root.

Then if I first save the file using xmlSaveFileEnc, reopen it by xmlParseFile the xmlDocPtr that I get can be validated against the same schema without any problem...
 
Has anybody an explanation ?
Must I do something to my xmlDocPtr in order to be able to validate it ?
 
Thanks for you help.
 
Patrick


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]