File:  [Public] / XML / schema.h
Revision 1.1: download - view: text, annotated - select for diffs
Mon Aug 7 13:43:51 2000 UTC (23 years, 9 months ago) by veillard
Branches: MAIN
CVS tags: LIBXML_2_2_8, LIBXML_2_2_6, HEAD
Commiting work done on the plane, mostly an attempt at XML Schema understanding
by coding ... Daniel

/*
 * 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