|
libxml2
|
incomplete XML Schemas structure implementation More...
Typedefs | |
| typedef struct _xmlSchema | xmlSchema |
| XML schema. | |
| typedef void(* | xmlSchemaValidityErrorFunc) (void *ctx, const char *msg,...) |
| Signature of an error callback from an XSD validation. | |
| typedef void(* | xmlSchemaValidityWarningFunc) (void *ctx, const char *msg,...) |
| Signature of a warning callback from an XSD validation. | |
| typedef struct _xmlSchemaParserCtxt | xmlSchemaParserCtxt |
| Schema parser context. | |
| typedef struct _xmlSchemaValidCtxt | xmlSchemaValidCtxt |
| Schema validation context. | |
| typedef int(* | xmlSchemaValidityLocatorFunc) (void *ctx, const char **file, unsigned long *line) |
| A schemas validation locator, a callback called by the validator. | |
| typedef struct _xmlSchemaSAXPlug | xmlSchemaSAXPlugStruct |
| Interface to insert Schemas SAX validation in a SAX stream. | |
Enumerations | |
| enum | xmlSchemaValidError |
| This error codes are obsolete; not used any more. | |
| enum | xmlSchemaValidOption |
| This is the set of XML Schema validation options. | |
Functions | |
| xmlSchemaParserCtxt * | xmlSchemaNewParserCtxt (const char *URL) |
| Create an XML Schemas parse context for that file/resource expected to contain an XML Schemas file. | |
| xmlSchemaParserCtxt * | xmlSchemaNewMemParserCtxt (const char *buffer, int size) |
| Create an XML Schemas parse context for that memory buffer expected to contain an XML Schemas file. | |
| xmlSchemaParserCtxt * | xmlSchemaNewDocParserCtxt (xmlDoc *doc) |
| Create an XML Schemas parse context for that document. | |
| void | xmlSchemaFreeParserCtxt (xmlSchemaParserCtxt *ctxt) |
| Free the resources associated to the schema parser context. | |
| void | xmlSchemaSetParserErrors (xmlSchemaParserCtxt *ctxt, xmlSchemaValidityErrorFunc err, xmlSchemaValidityWarningFunc warn, void *ctx) |
| Set the callback functions used to handle errors for a validation context. | |
| void | xmlSchemaSetParserStructuredErrors (xmlSchemaParserCtxt *ctxt, xmlStructuredErrorFunc serror, void *ctx) |
| Set the structured error callback. | |
| int | xmlSchemaGetParserErrors (xmlSchemaParserCtxt *ctxt, xmlSchemaValidityErrorFunc *err, xmlSchemaValidityWarningFunc *warn, void **ctx) |
| Get the callback information used to handle errors for a parser context. | |
| void | xmlSchemaSetResourceLoader (xmlSchemaParserCtxt *ctxt, xmlResourceLoader loader, void *data) |
| Register a callback function that will be called to load documents or external entities. | |
| int | xmlSchemaIsValid (xmlSchemaValidCtxt *ctxt) |
| Check if any error was detected during validation. | |
| xmlSchema * | xmlSchemaParse (xmlSchemaParserCtxt *ctxt) |
| parse a schema definition resource and build an internal XML Schema structure which can be used to validate instances. | |
| void | xmlSchemaFree (xmlSchema *schema) |
| Deallocate a Schema structure. | |
| void | xmlSchemaDump (FILE *output, xmlSchema *schema) |
| Dump a Schema structure. | |
| void | xmlSchemaSetValidErrors (xmlSchemaValidCtxt *ctxt, xmlSchemaValidityErrorFunc err, xmlSchemaValidityWarningFunc warn, void *ctx) |
| Set the error and warning callback information. | |
| void | xmlSchemaSetValidStructuredErrors (xmlSchemaValidCtxt *ctxt, xmlStructuredErrorFunc serror, void *ctx) |
| Set the structured error callback. | |
| int | xmlSchemaGetValidErrors (xmlSchemaValidCtxt *ctxt, xmlSchemaValidityErrorFunc *err, xmlSchemaValidityWarningFunc *warn, void **ctx) |
| Get the error and warning callback information. | |
| int | xmlSchemaSetValidOptions (xmlSchemaValidCtxt *ctxt, int options) |
| Sets the options to be used during the validation. | |
| void | xmlSchemaValidateSetFilename (xmlSchemaValidCtxt *vctxt, const char *filename) |
| Workaround to provide file error reporting information when this is not provided by current APIs. | |
| int | xmlSchemaValidCtxtGetOptions (xmlSchemaValidCtxt *ctxt) |
| Get the validation context options. | |
| xmlSchemaValidCtxt * | xmlSchemaNewValidCtxt (xmlSchema *schema) |
| Create an XML Schemas validation context based on the given schema. | |
| void | xmlSchemaFreeValidCtxt (xmlSchemaValidCtxt *ctxt) |
| Free the resources associated to the schema validation context. | |
| int | xmlSchemaValidateDoc (xmlSchemaValidCtxt *ctxt, xmlDoc *instance) |
| Validate a document tree in memory. | |
| int | xmlSchemaValidateOneElement (xmlSchemaValidCtxt *ctxt, xmlNode *elem) |
| Validate a branch of a tree, starting with the given elem. | |
| int | xmlSchemaValidateStream (xmlSchemaValidCtxt *ctxt, xmlParserInputBuffer *input, xmlCharEncoding enc, const xmlSAXHandler *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. | |
| int | xmlSchemaValidateFile (xmlSchemaValidCtxt *ctxt, const char *filename, int options) |
| Do a schemas validation of the given resource, it will use the SAX streamable validation internally. | |
| xmlParserCtxt * | xmlSchemaValidCtxtGetParserCtxt (xmlSchemaValidCtxt *ctxt) |
| allow access to the parser context of the schema validation context | |
| xmlSchemaSAXPlugStruct * | xmlSchemaSAXPlug (xmlSchemaValidCtxt *ctxt, xmlSAXHandler **sax, void **user_data) |
| Plug a SAX based validation layer in a SAX parsing event flow. | |
| int | xmlSchemaSAXUnplug (xmlSchemaSAXPlugStruct *plug) |
| Unplug a SAX based validation layer in a SAX parsing event flow. | |
| void | xmlSchemaValidateSetLocator (xmlSchemaValidCtxt *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. | |
incomplete XML Schemas structure implementation
interface to the XML Schemas handling and schema validity checking, it is incomplete right now.
| typedef void(* xmlSchemaValidityErrorFunc) (void *ctx, const char *msg,...) |
Signature of an error callback from an XSD validation.
| ctx | the validation context |
| msg | the message |
| ... | extra arguments |
| typedef 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 information 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 |
| typedef 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 |
| void xmlSchemaDump | ( | FILE * | output, |
| xmlSchema * | schema ) |
Dump a Schema structure.
| output | the file output |
| schema | a schema structure |
| void xmlSchemaFree | ( | xmlSchema * | schema | ) |
Deallocate a Schema structure.
| schema | a schema structure |
| void xmlSchemaFreeParserCtxt | ( | xmlSchemaParserCtxt * | ctxt | ) |
Free the resources associated to the schema parser context.
| ctxt | the schema parser context |
| void xmlSchemaFreeValidCtxt | ( | xmlSchemaValidCtxt * | ctxt | ) |
Free the resources associated to the schema validation context.
| ctxt | the schema validation context |
| int xmlSchemaGetParserErrors | ( | xmlSchemaParserCtxt * | 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 |
| int xmlSchemaGetValidErrors | ( | xmlSchemaValidCtxt * | ctxt, |
| xmlSchemaValidityErrorFunc * | err, | ||
| xmlSchemaValidityWarningFunc * | warn, | ||
| void ** | ctx ) |
Get the error and warning callback information.
| ctxt | a XML-Schema validation context |
| err | the error function result |
| warn | the warning function result |
| ctx | the functions context result |
| int xmlSchemaIsValid | ( | xmlSchemaValidCtxt * | ctxt | ) |
Check if any error was detected during validation.
| ctxt | the schema validation context |
| xmlSchemaParserCtxt * xmlSchemaNewDocParserCtxt | ( | xmlDoc * | 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 |
| xmlSchemaParserCtxt * 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 |
| xmlSchemaParserCtxt * 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 |
| xmlSchemaValidCtxt * xmlSchemaNewValidCtxt | ( | xmlSchema * | schema | ) |
Create an XML Schemas validation context based on the given schema.
| schema | a precompiled XML Schemas |
| xmlSchema * xmlSchemaParse | ( | xmlSchemaParserCtxt * | ctxt | ) |
parse a schema definition resource and build an internal XML Schema structure which can be used to validate instances.
| ctxt | a schema validation context |
| xmlSchemaSAXPlugStruct * xmlSchemaSAXPlug | ( | xmlSchemaValidCtxt * | ctxt, |
| xmlSAXHandler ** | sax, | ||
| void ** | user_data ) |
Plug a SAX based validation layer in a SAX parsing event flow.
The original saxptr and dataptr data are replaced by new pointers but the calls to the original will be maintained.
| ctxt | a schema validation context |
| sax | a pointer to the original xmlSAXHandler |
| user_data | a pointer to the original SAX user data pointer |
| int xmlSchemaSAXUnplug | ( | xmlSchemaSAXPlugStruct * | plug | ) |
Unplug a SAX based validation layer in a SAX parsing event flow.
The original pointers used in the call are restored.
| plug | a data structure returned by xmlSchemaSAXPlug |
| void xmlSchemaSetParserErrors | ( | xmlSchemaParserCtxt * | 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 |
| void xmlSchemaSetParserStructuredErrors | ( | xmlSchemaParserCtxt * | ctxt, |
| xmlStructuredErrorFunc | serror, | ||
| void * | ctx ) |
Set the structured error callback.
| ctxt | a schema parser context |
| serror | the structured error function |
| ctx | the functions context |
| void xmlSchemaSetResourceLoader | ( | xmlSchemaParserCtxt * | ctxt, |
| xmlResourceLoader | loader, | ||
| void * | data ) |
Register a callback function that will be called to load documents or external entities.
| ctxt | schema parser |
| loader | resource loader |
| data | user data which will be passed to the loader |
| void xmlSchemaSetValidErrors | ( | xmlSchemaValidCtxt * | ctxt, |
| xmlSchemaValidityErrorFunc | err, | ||
| xmlSchemaValidityWarningFunc | warn, | ||
| void * | ctx ) |
Set the error and warning callback information.
| ctxt | a schema validation context |
| err | the error function |
| warn | the warning function |
| ctx | the functions context |
| int xmlSchemaSetValidOptions | ( | xmlSchemaValidCtxt * | ctxt, |
| int | options ) |
Sets the options to be used during the validation.
| ctxt | a schema validation context |
| options | a combination of xmlSchemaValidOption |
| void xmlSchemaSetValidStructuredErrors | ( | xmlSchemaValidCtxt * | ctxt, |
| xmlStructuredErrorFunc | serror, | ||
| void * | ctx ) |
Set the structured error callback.
| ctxt | a schema validation context |
| serror | the structured error function |
| ctx | the functions context |
| int xmlSchemaValidateDoc | ( | xmlSchemaValidCtxt * | ctxt, |
| xmlDoc * | doc ) |
Validate a document tree in memory.
| ctxt | a schema validation context |
| doc | a parsed document tree |
| int xmlSchemaValidateFile | ( | xmlSchemaValidCtxt * | ctxt, |
| const char * | filename, | ||
| int | options ) |
Do a schemas validation of the given resource, it will use the SAX streamable validation internally.
| ctxt | a schema validation context |
| filename | the URI of the instance |
| options | a future set of options, currently unused |
| int xmlSchemaValidateOneElement | ( | xmlSchemaValidCtxt * | ctxt, |
| xmlNode * | elem ) |
Validate a branch of a tree, starting with the given elem.
| ctxt | a schema validation context |
| elem | an element node |
| void xmlSchemaValidateSetFilename | ( | xmlSchemaValidCtxt * | 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 |
| void xmlSchemaValidateSetLocator | ( | xmlSchemaValidCtxt * | 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 |
| int xmlSchemaValidateStream | ( | xmlSchemaValidCtxt * | ctxt, |
| xmlParserInputBuffer * | input, | ||
| xmlCharEncoding | enc, | ||
| const xmlSAXHandler * | 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.
| 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. |
| int xmlSchemaValidCtxtGetOptions | ( | xmlSchemaValidCtxt * | ctxt | ) |
Get the validation context options.
| ctxt | a schema validation context |
| xmlParserCtxt * xmlSchemaValidCtxtGetParserCtxt | ( | xmlSchemaValidCtxt * | ctxt | ) |
allow access to the parser context of the schema validation context
| ctxt | a schema validation context |