|
libxml2
|
implementation of the Relax-NG validation More...
Typedefs | |
| typedef struct _xmlRelaxNG | xmlRelaxNG |
| RelaxNG schema. | |
| typedef void(* | xmlRelaxNGValidityErrorFunc) (void *ctx, const char *msg,...) |
| Signature of an error callback from a Relax-NG validation. | |
| typedef void(* | xmlRelaxNGValidityWarningFunc) (void *ctx, const char *msg,...) |
| Signature of a warning callback from a Relax-NG validation. | |
| typedef struct _xmlRelaxNGParserCtxt | xmlRelaxNGParserCtxt |
| RelaxNG parser context. | |
| typedef struct _xmlRelaxNGValidCtxt | xmlRelaxNGValidCtxt |
| RelaxNG validation context. | |
Enumerations | |
| enum | xmlRelaxNGValidErr |
| List of possible Relax NG validation errors. | |
| enum | xmlRelaxNGParserFlag |
| List of possible Relax NG Parser flags. | |
Functions | |
| int | xmlRelaxNGInitTypes (void) |
| Initialize the default type libraries. | |
| void | xmlRelaxNGCleanupTypes (void) |
| Cleanup the default Schemas type library associated to RelaxNG. | |
| xmlRelaxNGParserCtxt * | xmlRelaxNGNewParserCtxt (const char *URL) |
| Create an XML RelaxNGs parse context for that file/resource expected to contain an XML RelaxNGs file. | |
| xmlRelaxNGParserCtxt * | xmlRelaxNGNewMemParserCtxt (const char *buffer, int size) |
| Create an XML RelaxNGs parse context for that memory buffer expected to contain an XML RelaxNGs file. | |
| xmlRelaxNGParserCtxt * | xmlRelaxNGNewDocParserCtxt (xmlDoc *doc) |
| Create an XML RelaxNGs parser context for that document. | |
| int | xmlRelaxParserSetFlag (xmlRelaxNGParserCtxt *ctxt, int flag) |
| Semi private function used to pass information to a parser context which are a combination of xmlRelaxNGParserFlag . | |
| void | xmlRelaxNGFreeParserCtxt (xmlRelaxNGParserCtxt *ctxt) |
| Free the resources associated to the schema parser context. | |
| void | xmlRelaxNGSetParserErrors (xmlRelaxNGParserCtxt *ctxt, xmlRelaxNGValidityErrorFunc err, xmlRelaxNGValidityWarningFunc warn, void *ctx) |
| Set the callback functions used to handle errors for a validation context. | |
| int | xmlRelaxNGGetParserErrors (xmlRelaxNGParserCtxt *ctxt, xmlRelaxNGValidityErrorFunc *err, xmlRelaxNGValidityWarningFunc *warn, void **ctx) |
| Get the callback information used to handle errors for a validation context. | |
| void | xmlRelaxNGSetParserStructuredErrors (xmlRelaxNGParserCtxt *ctxt, xmlStructuredErrorFunc serror, void *ctx) |
| Set the callback functions used to handle errors for a parsing context. | |
| void | xmlRelaxNGSetResourceLoader (xmlRelaxNGParserCtxt *ctxt, xmlResourceLoader loader, void *vctxt) |
| Set the callback function used to load external resources. | |
| xmlRelaxNG * | xmlRelaxNGParse (xmlRelaxNGParserCtxt *ctxt) |
| parse a schema definition resource and build an internal XML Schema structure which can be used to validate instances. | |
| void | xmlRelaxNGFree (xmlRelaxNG *schema) |
| Deallocate a RelaxNG structure. | |
| void | xmlRelaxNGDump (FILE *output, xmlRelaxNG *schema) |
| Dump a RelaxNG structure back. | |
| void | xmlRelaxNGDumpTree (FILE *output, xmlRelaxNG *schema) |
| Dump the transformed RelaxNG tree. | |
| void | xmlRelaxNGSetValidErrors (xmlRelaxNGValidCtxt *ctxt, xmlRelaxNGValidityErrorFunc err, xmlRelaxNGValidityWarningFunc warn, void *ctx) |
| Set the error and warning callback information. | |
| int | xmlRelaxNGGetValidErrors (xmlRelaxNGValidCtxt *ctxt, xmlRelaxNGValidityErrorFunc *err, xmlRelaxNGValidityWarningFunc *warn, void **ctx) |
| Get the error and warning callback information. | |
| void | xmlRelaxNGSetValidStructuredErrors (xmlRelaxNGValidCtxt *ctxt, xmlStructuredErrorFunc serror, void *ctx) |
| Set the structured error callback. | |
| xmlRelaxNGValidCtxt * | xmlRelaxNGNewValidCtxt (xmlRelaxNG *schema) |
| Create an XML RelaxNGs validation context based on the given schema. | |
| void | xmlRelaxNGFreeValidCtxt (xmlRelaxNGValidCtxt *ctxt) |
| Free the resources associated to the schema validation context. | |
| int | xmlRelaxNGValidateDoc (xmlRelaxNGValidCtxt *ctxt, xmlDoc *doc) |
| Validate a document tree in memory. | |
| int | xmlRelaxNGValidatePushElement (xmlRelaxNGValidCtxt *ctxt, xmlDoc *doc, xmlNode *elem) |
| Push a new element start on the RelaxNG validation stack. | |
| int | xmlRelaxNGValidatePushCData (xmlRelaxNGValidCtxt *ctxt, const xmlChar *data, int len) |
| check the CData parsed for validation in the current stack | |
| int | xmlRelaxNGValidatePopElement (xmlRelaxNGValidCtxt *ctxt, xmlDoc *doc, xmlNode *elem) |
| Pop the element end from the RelaxNG validation stack. | |
| int | xmlRelaxNGValidateFullElement (xmlRelaxNGValidCtxt *ctxt, xmlDoc *doc, xmlNode *elem) |
| Validate a full subtree when xmlRelaxNGValidatePushElement returned 0 and the content of the node has been expanded. | |
| void | xmlRelaxNGValidCtxtClearErrors (xmlRelaxNGValidCtxt *ctxt) |
| Clear errors in the context, allowing to recover from errors during streaming validation and continue it. | |
implementation of the Relax-NG validation
implementation of the Relax-NG validation
| typedef void(* xmlRelaxNGValidityErrorFunc) (void *ctx, const char *msg,...) |
Signature of an error callback from a Relax-NG validation.
| ctx | the validation context |
| msg | the message |
| ... | extra arguments |
| typedef void(* xmlRelaxNGValidityWarningFunc) (void *ctx, const char *msg,...) |
Signature of a warning callback from a Relax-NG validation.
| ctx | the validation context |
| msg | the message |
| ... | extra arguments |
| void xmlRelaxNGCleanupTypes | ( | void | ) |
Cleanup the default Schemas type library associated to RelaxNG.
| void xmlRelaxNGDump | ( | FILE * | output, |
| xmlRelaxNG * | schema ) |
Dump a RelaxNG structure back.
| output | the file output |
| schema | a schema structure |
| void xmlRelaxNGDumpTree | ( | FILE * | output, |
| xmlRelaxNG * | schema ) |
Dump the transformed RelaxNG tree.
| output | the file output |
| schema | a schema structure |
| void xmlRelaxNGFree | ( | xmlRelaxNG * | schema | ) |
Deallocate a RelaxNG structure.
| schema | a schema structure |
| void xmlRelaxNGFreeParserCtxt | ( | xmlRelaxNGParserCtxt * | ctxt | ) |
Free the resources associated to the schema parser context.
| ctxt | the schema parser context |
| void xmlRelaxNGFreeValidCtxt | ( | xmlRelaxNGValidCtxt * | ctxt | ) |
Free the resources associated to the schema validation context.
| ctxt | the schema validation context |
| int xmlRelaxNGGetParserErrors | ( | xmlRelaxNGParserCtxt * | ctxt, |
| xmlRelaxNGValidityErrorFunc * | err, | ||
| xmlRelaxNGValidityWarningFunc * | warn, | ||
| void ** | ctx ) |
Get the callback information used to handle errors for a validation context.
| ctxt | a Relax-NG validation context |
| err | the error callback result |
| warn | the warning callback result |
| ctx | contextual data for the callbacks result |
| int xmlRelaxNGGetValidErrors | ( | xmlRelaxNGValidCtxt * | ctxt, |
| xmlRelaxNGValidityErrorFunc * | err, | ||
| xmlRelaxNGValidityWarningFunc * | warn, | ||
| void ** | ctx ) |
Get the error and warning callback information.
| ctxt | a Relax-NG validation context |
| err | the error function result |
| warn | the warning function result |
| ctx | the functions context result |
| int xmlRelaxNGInitTypes | ( | void | ) |
Initialize the default type libraries.
| xmlRelaxNGParserCtxt * xmlRelaxNGNewDocParserCtxt | ( | xmlDoc * | doc | ) |
Create an XML RelaxNGs parser context for that document.
Note: since the process of compiling a RelaxNG schemas modifies the document, the doc parameter is duplicated internally.
| doc | a preparsed document tree |
| xmlRelaxNGParserCtxt * xmlRelaxNGNewMemParserCtxt | ( | const char * | buffer, |
| int | size ) |
Create an XML RelaxNGs parse context for that memory buffer expected to contain an XML RelaxNGs file.
| buffer | a pointer to a char array containing the schemas |
| size | the size of the array |
| xmlRelaxNGParserCtxt * xmlRelaxNGNewParserCtxt | ( | const char * | URL | ) |
Create an XML RelaxNGs parse context for that file/resource expected to contain an XML RelaxNGs file.
| URL | the location of the schema |
| xmlRelaxNGValidCtxt * xmlRelaxNGNewValidCtxt | ( | xmlRelaxNG * | schema | ) |
Create an XML RelaxNGs validation context based on the given schema.
| schema | a precompiled XML RelaxNGs |
| xmlRelaxNG * xmlRelaxNGParse | ( | xmlRelaxNGParserCtxt * | ctxt | ) |
parse a schema definition resource and build an internal XML Schema structure which can be used to validate instances.
| ctxt | a Relax-NG parser context |
| void xmlRelaxNGSetParserErrors | ( | xmlRelaxNGParserCtxt * | ctxt, |
| xmlRelaxNGValidityErrorFunc | err, | ||
| xmlRelaxNGValidityWarningFunc | warn, | ||
| void * | ctx ) |
Set the callback functions used to handle errors for a validation context.
| ctxt | a Relax-NG validation context |
| err | the error callback |
| warn | the warning callback |
| ctx | contextual data for the callbacks |
| void xmlRelaxNGSetParserStructuredErrors | ( | xmlRelaxNGParserCtxt * | ctxt, |
| xmlStructuredErrorFunc | serror, | ||
| void * | ctx ) |
Set the callback functions used to handle errors for a parsing context.
| ctxt | a Relax-NG parser context |
| serror | the error callback |
| ctx | contextual data for the callbacks |
| void xmlRelaxNGSetResourceLoader | ( | xmlRelaxNGParserCtxt * | ctxt, |
| xmlResourceLoader | loader, | ||
| void * | vctxt ) |
Set the callback function used to load external resources.
| ctxt | a Relax-NG parser context |
| loader | the callback |
| vctxt | contextual data for the callbacks |
| void xmlRelaxNGSetValidErrors | ( | xmlRelaxNGValidCtxt * | ctxt, |
| xmlRelaxNGValidityErrorFunc | err, | ||
| xmlRelaxNGValidityWarningFunc | warn, | ||
| void * | ctx ) |
Set the error and warning callback information.
| ctxt | a Relax-NG validation context |
| err | the error function |
| warn | the warning function |
| ctx | the functions context |
| void xmlRelaxNGSetValidStructuredErrors | ( | xmlRelaxNGValidCtxt * | ctxt, |
| xmlStructuredErrorFunc | serror, | ||
| void * | ctx ) |
Set the structured error callback.
| ctxt | a Relax-NG validation context |
| serror | the structured error function |
| ctx | the functions context |
| int xmlRelaxNGValidateDoc | ( | xmlRelaxNGValidCtxt * | ctxt, |
| xmlDoc * | doc ) |
Validate a document tree in memory.
| ctxt | a Relax-NG validation context |
| doc | a parsed document tree |
| int xmlRelaxNGValidateFullElement | ( | xmlRelaxNGValidCtxt * | ctxt, |
| xmlDoc * | doc, | ||
| xmlNode * | elem ) |
Validate a full subtree when xmlRelaxNGValidatePushElement returned 0 and the content of the node has been expanded.
| ctxt | the validation context |
| doc | a document instance |
| elem | an element instance |
| int xmlRelaxNGValidatePopElement | ( | xmlRelaxNGValidCtxt * | ctxt, |
| xmlDoc * | doc, | ||
| xmlNode * | elem ) |
Pop the element end from the RelaxNG validation stack.
| ctxt | the RelaxNG validation context |
| doc | a document instance |
| elem | an element instance |
| int xmlRelaxNGValidatePushCData | ( | xmlRelaxNGValidCtxt * | ctxt, |
| const xmlChar * | data, | ||
| int | len ) |
check the CData parsed for validation in the current stack
| ctxt | the RelaxNG validation context |
| data | some character data read |
| len | the length of the data |
| int xmlRelaxNGValidatePushElement | ( | xmlRelaxNGValidCtxt * | ctxt, |
| xmlDoc * | doc, | ||
| xmlNode * | elem ) |
Push a new element start on the RelaxNG validation stack.
| ctxt | the validation context |
| doc | a document instance |
| elem | an element instance |
| void xmlRelaxNGValidCtxtClearErrors | ( | xmlRelaxNGValidCtxt * | ctxt | ) |
Clear errors in the context, allowing to recover from errors during streaming validation and continue it.
| ctxt | the validation context |
| int xmlRelaxParserSetFlag | ( | xmlRelaxNGParserCtxt * | ctxt, |
| int | flags ) |
Semi private function used to pass information to a parser context which are a combination of xmlRelaxNGParserFlag .
| ctxt | a RelaxNG parser context |
| flags | a set of flags values |