[xml] xml Schema validation
- From: "Ganesh Sivaraman" <ganesh sivaraman wipro com>
- To: <xml gnome org>
- Subject: [xml] xml Schema validation
- Date: Tue, 10 Dec 2002 11:47:25 +0530
Hi,
I'm trying to validate an xml Schema...and here's the error message I get:
1. "..........................
Type of complexContent 10 : schema.xsd:0 :basic
Building content model for tuple
Unimplemented block at xmlschemas.c:3095
Building content model for presence
Unimplemented block at xmlschemas.c:3095
Building content model for contact
Found unexpected type 9 in contact content model
Building content model for status
Unimplemented block at xmlschemas.c:3095
..........................."
This would mean that the schema is not validated, right?
I found a similar post in the archives (June, 2002) but there was no reply to it.
Can anyone tell me what the problem is and how I can use this schema to validate other xml docs?
2. I also found another error message:
"Unable to lookup type anyURI:http://www.w3.org/2001/XMLSchemaUnable to lookup type
anyURI:http://www.w3.org/2001/XMLSchemaType of complexContent 8 : schema.xsd:0 :unknown !!!"
Does it matter that the given URL was not found?
The code I wrote to validate the schema is:
----------------------------------------------------------------------------
void validateSchema(char* schema)
{
xmlSchemaPtr schemaPtr;
xmlSchemaParserCtxtPtr schemaPrsrCtxtPtr = xmlSchemaNewParserCtxt(schema);
if(NULL == schemaPrsrCtxtPtr)
{
xmlGenericError(xmlGenericErrorContext,
"Could not create new SchemaParserContext for: %s\n", schema);
return;
}
schemaPtr = xmlSchemaParse(schemaPrsrCtxtPtr);
if(NULL == schemaPtr)
{
xmlGenericError(xmlGenericErrorContext,
"Could not parse XML Schema: %s\n", schema);
xmlSchemaFreeParserCtxt(schemaPrsrCtxtPtr);
xmlSchemaFree(schemaPtr);
return;
}
printf("\nXML SCHEMA VALIDATED!!!\n");
}
----------------------------------------------------------------------------
Thanks
Ganesh
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]