/*
* schema.h : interface to the XML Schema handling and schema validity checking
*
* See Copyright for the status of this software.
*
* Daniel.Veillard@w3.org
*/
#ifndef __XML_SCHEMA_H__
#define __XML_SCHEMA_H__
#include <libxml/tree.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* The schemas related types are kept internal
*/
typedef struct _xmlSchema xmlSchema;
typedef xmlSchema *xmlSchemaPtr;
/**
* A schemas validation context
*/
typedef void (*xmlSchemaValidityErrorFunc) (void *ctx, const char *msg, ...);
typedef void (*xmlSchemaValidityWarningFunc) (void *ctx, const char *msg, ...);
typedef struct _xmlSchemaValidCtxt xmlSchemaValidCtxt;
typedef xmlSchemaValidCtxt *xmlSchemaValidCtxtPtr;
struct _xmlSchemaValidCtxt {
void *userData; /* user specific data block */
xmlSchemaValidityErrorFunc error; /* the callback in case of errors */
xmlSchemaValidityWarningFunc warning;/* the callback in case of warning */
xmlSchemaPtr schema; /* The schema in use */
/* Node analysis stack used when validating within entities */
xmlNodePtr node; /* Current parsed Node */
int nodeNr; /* Depth of the parsing stack */
int nodeMax; /* Max depth of the parsing stack */
xmlNodePtr *nodeTab; /* array of nodes */
};
/*
* Interfaces
*/
xmlSchemaPtr xmlSchemaLoad (xmlSchemaValidCtxtPtr ctxt,
const char *URL);
void xmlSchemaFree (xmlSchemaPtr schema);
int xmlSchemaValidate (xmlSchemaValidCtxtPtr ctxt,
xmlNodePtr instance,
xmlSchemaPtr schema);
#ifdef __cplusplus
}
#endif
#endif /* __XML_SCHEMA_H__ */
Webmaster