[xml] Schema validation from API
- From: Garcia Jose Miguel-JGARCIR1 <jmgarcia motorola com>
- To: xml gnome org
- Subject: [xml] Schema validation from API
- Date: Mon, 26 Apr 2004 12:37:00 +0200
Hi all,
I´m trying to validate a XML file by schema.xsd
With xmllint, everything is Ok,
xmllint --noout --schema test.xsd test.xml
test.xml validates
How should I make this validation through API ?
reader = xmlReaderForFile(test.xsd , NULL, NULL);
schema_parse = xmlSchemaNewParserCtxt("test.xsd");
schema = xmlSchemaParse(schema_parse);
schema_valid = xmlSchemaNewValidCtxt(schema);
doc = xmlTextReaderCurrentDoc(reader);
res_val = xmlSchemaValidateDoc (schema_valid, doc); //int xmlSchemaValidateDoc (xmlSchemaValidCtxtPtr ctxt,
xmlDocPtr doc)
Thank you in advance.
______________________
José Miguel García
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]