Re: [xml] libxml2 does xmlSchemaValidateDoc() support xml schema extensions?
- From: Andy Davidson <andy_davidson apple com>
- To: Piotr Sipika <piotreks optonline net>
- Cc: xml gnome org
- Subject: Re: [xml] libxml2 does xmlSchemaValidateDoc() support xml schema extensions?
- Date: Tue, 13 Dec 2011 08:45:54 -0800
Hi Piotr
One thing I would suggest is NOT releasing any of the resources
associated with the schema before validation (do that after, instead).
//xmlSchemaFree(schema); causes crash when we try to use validCtxt
xmlSchemaFreeParserCtxt(parserCtxt);
xmlFreeDoc(schemaDoc);
//
http://www.xmlsoft.org/html/libxml-xmlschemas.html#xmlSchemaValidateDoc
int error = xmlSchemaValidateDoc(validCtxt.validCtxt, doc);
if (error == 0) {
NSLog(@"document is a valid instance of %@", schemaFileName);
ret = YES;
}
I'll try making the change you suggest. The reason I structured the code this way was that I am working on a
transactional system with over 100 xsd files. I load the validCtxt and cache them as needed. I tried to free
up all the unnecessary memory to keep my foot print as small as possible.
Thanks
Andy
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]