--- embedaddon/libxml2/doc/devhelp/libxml2-xmlschemas.html 2012/02/21 23:37:59 1.1 +++ embedaddon/libxml2/doc/devhelp/libxml2-xmlschemas.html 2014/06/15 19:53:35 1.1.1.2 @@ -57,12 +57,14 @@ typedef struct _xmlSchemaValidCtxt xmlSchemaSAXUnplug (xmlSchemaSAXPlugPtr plug); xmlSchemaPtr xmlSchemaParse (xmlSchemaParserCtxtPtr ctxt); void xmlSchemaFreeParserCtxt (xmlSchemaParserCtxtPtr ctxt); +void xmlSchemaValidateSetFilename (xmlSchemaValidCtxtPtr vctxt,
const char * filename); 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); +void xmlSchemaValidateSetLocator (xmlSchemaValidCtxtPtr vctxt,
xmlSchemaValidityLocatorFunc f,
void * ctxt); int xmlSchemaValidateOneElement (xmlSchemaValidCtxtPtr ctxt,
xmlNodePtr elem); void xmlSchemaSetValidStructuredErrors (xmlSchemaValidCtxtPtr ctxt,
xmlStructuredErrorFunc serror,
void * ctx); void xmlSchemaSetValidErrors (xmlSchemaValidCtxtPtr ctxt,
xmlSchemaValidityErrorFunc err,
xmlSchemaValidityWarningFunc warn,
void * ctx); @@ -71,6 +73,7 @@ int xmlSchemaValidate int xmlSchemaValidateDoc (xmlSchemaValidCtxtPtr ctxt,
xmlDocPtr doc); void xmlSchemaFree (xmlSchemaPtr schema); xmlSchemaParserCtxtPtr xmlSchemaNewMemParserCtxt (const char * buffer,
int size); +typedef int xmlSchemaValidityLocatorFunc (void * ctx,
const char ** file,
unsigned long * line); 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); @@ -189,6 +192,10 @@ The content of this structure is not made public by th

Signature of an error callback from an XSD validation

ctx:the validation context
msg:the message
...:extra arguments

+

Function type xmlSchemaValidityLocatorFunc

int	xmlSchemaValidityLocatorFunc	(void * ctx, 
const char ** file,
unsigned long * line)
+

A schemas validation locator, a callback called by the validator. This is used when file or node informations are not available to find out what file and line number are affected

+
ctx:user provided context
file:returned file information
line:returned line information
Returns:0 in case of success and -1 in case of error
+

Function type xmlSchemaValidityWarningFunc

void	xmlSchemaValidityWarningFunc	(void * ctx, 
const char * msg,
... ...)

Signature of a warning callback from an XSD validation

ctx:the validation context
msg:the message
...:extra arguments
@@ -288,6 +295,14 @@ The content of this structure is not made public by th

xmlSchemaValidateOneElement ()

int	xmlSchemaValidateOneElement	(xmlSchemaValidCtxtPtr ctxt, 
xmlNodePtr elem)

Validate a branch of a tree, starting with the given @elem.

ctxt:a schema validation context
elem:an element node
Returns:0 if the element and its subtree is valid, a positive error code number otherwise and -1 in case of an internal or API error.
+
+

xmlSchemaValidateSetFilename ()

void	xmlSchemaValidateSetFilename	(xmlSchemaValidCtxtPtr vctxt, 
const char * filename)
+

Workaround to provide file error reporting information when this is not provided by current APIs

+
vctxt:the schema validation context
filename:the file name
+
+

xmlSchemaValidateSetLocator ()

void	xmlSchemaValidateSetLocator	(xmlSchemaValidCtxtPtr vctxt, 
xmlSchemaValidityLocatorFunc f,
void * ctxt)
+

Allows to set a locator function to the validation context, which will be used to provide file and line information since those are not provided as part of the SAX validation flow Setting @f to NULL disable the locator.

+
vctxt:a schema validation context
f:the locator function pointer
ctxt:the locator context

xmlSchemaValidateStream ()

int	xmlSchemaValidateStream		(xmlSchemaValidCtxtPtr ctxt, 
xmlParserInputBufferPtr input,
xmlCharEncoding enc,
xmlSAXHandlerPtr sax,
void * user_data)

Validate an input based on a flow of SAX event from the parser and forward the events to the @sax handler with the provided @user_data the user provided @sax handler must be a SAX2 one.