xmlschemas

xmlschemas - incomplete XML Schemas structure implementation

interface to the XML Schemas handling and schema validity checking, it is incomplete right now.

Author(s): Daniel Veillard

Synopsis

typedef xmlSchema * xmlSchemaPtr;
typedef struct _xmlSchemaParserCtxt xmlSchemaParserCtxt;
typedef enum xmlSchemaValidOption;
typedef xmlSchemaSAXPlugStruct * xmlSchemaSAXPlugPtr;
typedef struct _xmlSchemaSAXPlug xmlSchemaSAXPlugStruct;
typedef xmlSchemaValidCtxt * xmlSchemaValidCtxtPtr;
typedef xmlSchemaParserCtxt * xmlSchemaParserCtxtPtr;
typedef struct _xmlSchema xmlSchema;
typedef enum xmlSchemaValidError;
typedef struct _xmlSchemaValidCtxt xmlSchemaValidCtxt;
xmlSchemaParserCtxtPtr	xmlSchemaNewDocParserCtxt	(xmlDocPtr doc);
int	xmlSchemaSAXUnplug		(xmlSchemaSAXPlugPtr plug);
xmlSchemaPtr	xmlSchemaParse		(xmlSchemaParserCtxtPtr ctxt);
void	xmlSchemaFreeParserCtxt		(xmlSchemaParserCtxtPtr ctxt);
xmlSchemaParserCtxtPtr	xmlSchemaNewParserCtxt	(const char * URL);
int	xmlSchemaIsValid		(xmlSchemaValidCtxtPtr ctxt);
typedef void xmlSchemaValidityErrorFunc	(void * ctx, 
const char * msg,
... ...); xmlSchemaSAXPlugPtr xmlSchemaSAXPlug (xmlSchemaValidCtxtPtr ctxt,
xmlSAXHandlerPtr * sax,
void ** user_data); int xmlSchemaValidateStream (xmlSchemaValidCtxtPtr ctxt,
xmlParserInputBufferPtr input,
xmlCharEncoding enc,
xmlSAXHandlerPtr sax,
void * user_data); int xmlSchemaGetParserErrors (xmlSchemaParserCtxtPtr ctxt,
xmlSchemaValidityErrorFunc * err,
xmlSchemaValidityWarningFunc * warn,
void ** ctx); int xmlSchemaValidateOneElement (xmlSchemaValidCtxtPtr ctxt,
xmlNodePtr elem); void xmlSchemaSetValidStructuredErrors (xmlSchemaValidCtxtPtr ctxt,
xmlStructuredErrorFunc serror,
void * ctx); void xmlSchemaSetValidErrors (xmlSchemaValidCtxtPtr ctxt,
xmlSchemaValidityErrorFunc err,
xmlSchemaValidityWarningFunc warn,
void * ctx); int xmlSchemaValidCtxtGetOptions (xmlSchemaValidCtxtPtr ctxt); int xmlSchemaValidateFile (xmlSchemaValidCtxtPtr ctxt,
const char * filename,
int options); int xmlSchemaValidateDoc (xmlSchemaValidCtxtPtr ctxt,
xmlDocPtr instance); void xmlSchemaFree (xmlSchemaPtr schema); xmlSchemaParserCtxtPtr xmlSchemaNewMemParserCtxt (const char * buffer,
int size); int xmlSchemaGetValidErrors (xmlSchemaValidCtxtPtr ctxt,
xmlSchemaValidityErrorFunc * err,
xmlSchemaValidityWarningFunc * warn,
void ** ctx); int xmlSchemaSetValidOptions (xmlSchemaValidCtxtPtr ctxt,
int options); void xmlSchemaSetParserErrors (xmlSchemaParserCtxtPtr ctxt,
xmlSchemaValidityErrorFunc err,
xmlSchemaValidityWarningFunc warn,
void * ctx); typedef void xmlSchemaValidityWarningFunc (void * ctx,
const char * msg,
... ...); void xmlSchemaDump (FILE * output,
xmlSchemaPtr schema); void xmlSchemaFreeValidCtxt (xmlSchemaValidCtxtPtr ctxt); void xmlSchemaSetParserStructuredErrors (xmlSchemaParserCtxtPtr ctxt,
xmlStructuredErrorFunc serror,
void * ctx); xmlSchemaValidCtxtPtr xmlSchemaNewValidCtxt (xmlSchemaPtr schema);

Description

Details

Structure xmlSchema

struct _xmlSchema {
    const xmlChar *	name	: schema name
    const xmlChar *	targetNamespace	: the target namespace
    const xmlChar *	version
    const xmlChar *	id	: Obsolete
    xmlDocPtr	doc
    xmlSchemaAnnotPtr	annot
    int	flags
    xmlHashTablePtr	typeDecl
    xmlHashTablePtr	attrDecl
    xmlHashTablePtr	attrgrpDecl
    xmlHashTablePtr	elemDecl
    xmlHashTablePtr	notaDecl
    xmlHashTablePtr	schemasImports
    void *	_private	: unused by the library for users or bindings
    xmlHashTablePtr	groupDecl
    xmlDictPtr	dict
    void *	includes	: the includes, this is opaque for now
    int	preserve	: whether to free the document
    int	counter	: used to give ononymous components unique names
    xmlHashTablePtr	idcDef	: All identity-constraint defs.
    void *	volatiles	: Obsolete
} xmlSchema;


Structure xmlSchemaParserCtxt

struct _xmlSchemaParserCtxt {
The content of this structure is not made public by the API.
} xmlSchemaParserCtxt;


Typedef xmlSchemaParserCtxtPtr

xmlSchemaParserCtxt * xmlSchemaParserCtxtPtr;


Typedef xmlSchemaPtr

xmlSchema * xmlSchemaPtr;


Typedef xmlSchemaSAXPlugPtr

xmlSchemaSAXPlugStruct * xmlSchemaSAXPlugPtr;


Structure xmlSchemaSAXPlugStruct

struct _xmlSchemaSAXPlug {
The content of this structure is not made public by the API.
} xmlSchemaSAXPlugStruct;


Structure xmlSchemaValidCtxt

struct _xmlSchemaValidCtxt {
The content of this structure is not made public by the API.
} xmlSchemaValidCtxt;


Typedef xmlSchemaValidCtxtPtr

xmlSchemaValidCtxt * xmlSchemaValidCtxtPtr;



Enum xmlSchemaValidOption

enum xmlSchemaValidOption {
    XML_SCHEMA_VAL_VC_I_CREATE = 1 /*  Default/fixed: create an attribute node * or an element's text node on the instance. * */
};




xmlSchemaDump ()

void	xmlSchemaDump			(FILE * output, 
xmlSchemaPtr schema)

Dump a Schema structure.

output:the file output
schema:a schema structure

xmlSchemaFree ()

void	xmlSchemaFree			(xmlSchemaPtr schema)

Deallocate a Schema structure.

schema:a schema structure

xmlSchemaFreeParserCtxt ()

void	xmlSchemaFreeParserCtxt		(xmlSchemaParserCtxtPtr ctxt)

Free the resources associated to the schema parser context

ctxt:the schema parser context


xmlSchemaGetParserErrors ()

int	xmlSchemaGetParserErrors	(xmlSchemaParserCtxtPtr ctxt, 
xmlSchemaValidityErrorFunc * err,
xmlSchemaValidityWarningFunc * warn,
void ** ctx)

Get the callback information used to handle errors for a parser context

ctxt:a XMl-Schema parser context
err:the error callback result
warn:the warning callback result
ctx:contextual data for the callbacks result
Returns:-1 in case of failure, 0 otherwise



xmlSchemaNewDocParserCtxt ()

xmlSchemaParserCtxtPtr	xmlSchemaNewDocParserCtxt	(xmlDocPtr doc)

Create an XML Schemas parse context for that document. NB. The document may be modified during the parsing process.

doc:a preparsed document tree
Returns:the parser context or NULL in case of error

xmlSchemaNewMemParserCtxt ()

xmlSchemaParserCtxtPtr	xmlSchemaNewMemParserCtxt	(const char * buffer, 
int size)

Create an XML Schemas parse context for that memory buffer expected to contain an XML Schemas file.

buffer:a pointer to a char array containing the schemas
size:the size of the array
Returns:the parser context or NULL in case of error

xmlSchemaNewParserCtxt ()

xmlSchemaParserCtxtPtr	xmlSchemaNewParserCtxt	(const char * URL)

Create an XML Schemas parse context for that file/resource expected to contain an XML Schemas file.

URL:the location of the schema
Returns:the parser context or NULL in case of error

xmlSchemaNewValidCtxt ()

xmlSchemaValidCtxtPtr	xmlSchemaNewValidCtxt	(xmlSchemaPtr schema)

schema:
Returns:

xmlSchemaParse ()

xmlSchemaPtr	xmlSchemaParse		(xmlSchemaParserCtxtPtr ctxt)

parse a schema definition resource and build an internal XML Shema struture which can be used to validate instances.

ctxt:a schema validation context
Returns:the internal XML Schema structure built from the resource or NULL in case of error

xmlSchemaSAXPlug ()

xmlSchemaSAXPlugPtr	xmlSchemaSAXPlug	(xmlSchemaValidCtxtPtr ctxt, 
xmlSAXHandlerPtr * sax,
void ** user_data)

ctxt:
sax:
user_data:
Returns:


xmlSchemaSetParserErrors ()

void	xmlSchemaSetParserErrors	(xmlSchemaParserCtxtPtr ctxt, 
xmlSchemaValidityErrorFunc err,
xmlSchemaValidityWarningFunc warn,
void * ctx)

Set the callback functions used to handle errors for a validation context

ctxt:a schema validation context
err:the error callback
warn:the warning callback
ctx:contextual data for the callbacks

xmlSchemaSetParserStructuredErrors ()

void	xmlSchemaSetParserStructuredErrors	(xmlSchemaParserCtxtPtr ctxt, 
xmlStructuredErrorFunc serror,
void * ctx)

Set the structured error callback

ctxt:a schema parser context
serror:the structured error function
ctx:the functions context






xmlSchemaValidateFile ()

int	xmlSchemaValidateFile		(xmlSchemaValidCtxtPtr ctxt, 
const char * filename,
int options)

ctxt:
filename:
options:
Returns: