Gnome XML Library Reference Manual | |||
---|---|---|---|
<<< Previous Page | Home | Up | Next Page >>> |
typedef enum { XML_SCHEMAS_ERR_OK = 0, XML_SCHEMAS_ERR_NOROOT = 1, XML_SCHEMAS_ERR_UNDECLAREDELEM, XML_SCHEMAS_ERR_NOTTOPLEVEL, XML_SCHEMAS_ERR_MISSING, XML_SCHEMAS_ERR_WRONGELEM, XML_SCHEMAS_ERR_NOTYPE, XML_SCHEMAS_ERR_NOROLLBACK, XML_SCHEMAS_ERR_ISABSTRACT, XML_SCHEMAS_ERR_NOTEMPTY, XML_SCHEMAS_ERR_ELEMCONT, XML_SCHEMAS_ERR_HAVEDEFAULT, XML_SCHEMAS_ERR_NOTNILLABLE, XML_SCHEMAS_ERR_EXTRACONTENT, XML_SCHEMAS_ERR_INVALIDATTR, XML_SCHEMAS_ERR_INVALIDELEM, XML_SCHEMAS_ERR_NOTDETERMINIST, XML_SCHEMAS_ERR_CONSTRUCT, XML_SCHEMAS_ERR_INTERNAL, XML_SCHEMAS_ERR_NOTSIMPLE, XML_SCHEMAS_ERR_ATTRUNKNOWN, XML_SCHEMAS_ERR_ATTRINVALID, XML_SCHEMAS_ERR_, XML_SCHEMAS_ERR_XXX } xmlSchemaValidError; |
struct xmlSchema { xmlChar *name; /* schema name */ xmlChar *targetNamespace; /* the target namespace */ xmlChar *version; xmlChar *id; xmlDocPtr doc; xmlSchemaAnnotPtr annot; int flags; xmlHashTablePtr typeDecl; xmlHashTablePtr attrDecl; xmlHashTablePtr attrgrpDecl; xmlHashTablePtr elemDecl; xmlHashTablePtr notaDecl; }; |
void (*xmlSchemaValidityWarningFunc) (void *ctx, const char *msg, ...); |
xmlSchemaParserCtxtPtr xmlSchemaNewParserCtxt (const char *URL); |
Create an XML Schemas parse context for that file/resource expected to contain an XML Schemas file.
void xmlSchemaFreeParserCtxt (xmlSchemaParserCtxtPtr ctxt); |
Free the resources associated to the schema parser context
void xmlSchemaSetParserErrors (xmlSchemaParserCtxtPtr ctxt, xmlSchemaValidityErrorFunc err, xmlSchemaValidityWarningFunc warn, void *ctx); |
xmlSchemaPtr xmlSchemaParse (xmlSchemaParserCtxtPtr ctxt); |
Load, XML parse a schema definition resource and build an internal XML Shema struture which can be used to validate instances. *WARNING* this interface is highly subject to change
void xmlSchemaSetValidErrors (xmlSchemaValidCtxtPtr ctxt, xmlSchemaValidityErrorFunc err, xmlSchemaValidityWarningFunc warn, void *ctx); |
Set the error and warning callback informations
xmlSchemaValidCtxtPtr xmlSchemaNewValidCtxt (xmlSchemaPtr schema); |
Create an XML Schemas validation context based on the given schema
void xmlSchemaFreeValidCtxt (xmlSchemaValidCtxtPtr ctxt); |
Free the resources associated to the schema validation context
int xmlSchemaValidateDoc (xmlSchemaValidCtxtPtr ctxt, xmlDocPtr instance); |
Validate a document tree in memory.
int xmlSchemaValidateStream (xmlSchemaValidCtxtPtr ctxt, xmlParserInputBufferPtr input, xmlCharEncoding enc, xmlSAXHandlerPtr sax, void *user_data); |
Validate a document tree in memory.
ctxt : | a schema validation context |
input : | the input to use for reading the data |
enc : | an optional encoding information |
sax : | a SAX handler for the resulting events |
user_data : | the context to provide to the SAX handler. |
Returns : | 0 if the document is schemas valid, a positive error code number otherwise and -1 in case of internal or API error. |