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 _______________________________________________ xml mailing list, project page http://xmlsoft.org/ xml@gnome.org http://mail.gnome.org/mailman/listinfo/xml