version 1.1.1.2, 2013/07/22 01:22:18
|
version 1.1.1.3, 2014/06/15 19:53:31
|
Line 39
|
Line 39
|
static const xmlChar *xmlRelaxNGNs = (const xmlChar *) |
static const xmlChar *xmlRelaxNGNs = (const xmlChar *) |
"http://relaxng.org/ns/structure/1.0"; |
"http://relaxng.org/ns/structure/1.0"; |
|
|
#define IS_RELAXNG(node, type) \ | #define IS_RELAXNG(node, typ) \ |
((node != NULL) && (node->ns != NULL) && \ |
((node != NULL) && (node->ns != NULL) && \ |
(xmlStrEqual(node->name, (const xmlChar *) type)) && \ | (node->type == XML_ELEMENT_NODE) && \ |
| (xmlStrEqual(node->name, (const xmlChar *) typ)) && \ |
(xmlStrEqual(node->ns->href, xmlRelaxNGNs))) |
(xmlStrEqual(node->ns->href, xmlRelaxNGNs))) |
|
|
|
|
Line 60 static const xmlChar *xmlRelaxNGNs = (const xmlChar *)
|
Line 61 static const xmlChar *xmlRelaxNGNs = (const xmlChar *)
|
|
|
#define DEBUG_LIST 1 |
#define DEBUG_LIST 1 |
|
|
#define DEBUG_INCLUDE 1 | #define DEBUG_INCLUDE 1 |
|
|
#define DEBUG_ERROR 1 |
#define DEBUG_ERROR 1 |
|
|
Line 71 static const xmlChar *xmlRelaxNGNs = (const xmlChar *)
|
Line 72 static const xmlChar *xmlRelaxNGNs = (const xmlChar *)
|
|
|
#define MAX_ERROR 5 |
#define MAX_ERROR 5 |
|
|
#define TODO \ | #define TODO \ |
xmlGenericError(xmlGenericErrorContext, \ |
xmlGenericError(xmlGenericErrorContext, \ |
"Unimplemented block at %s:%d\n", \ |
"Unimplemented block at %s:%d\n", \ |
__FILE__, __LINE__); |
__FILE__, __LINE__); |
Line 421 struct _xmlRelaxNGDocument {
|
Line 422 struct _xmlRelaxNGDocument {
|
|
|
/************************************************************************ |
/************************************************************************ |
* * |
* * |
* Some factorized error routines * | * Some factorized error routines * |
* * |
* * |
************************************************************************/ |
************************************************************************/ |
|
|
Line 564 xmlRngVErr(xmlRelaxNGValidCtxtPtr ctxt, xmlNodePtr nod
|
Line 565 xmlRngVErr(xmlRelaxNGValidCtxtPtr ctxt, xmlNodePtr nod
|
} |
} |
|
|
/************************************************************************ |
/************************************************************************ |
* * | * * |
* Preliminary type checking interfaces * | * Preliminary type checking interfaces * |
* * | * * |
************************************************************************/ |
************************************************************************/ |
|
|
/** |
/** |
Line 654 struct _xmlRelaxNGTypeLibrary {
|
Line 655 struct _xmlRelaxNGTypeLibrary {
|
}; |
}; |
|
|
/************************************************************************ |
/************************************************************************ |
* * | * * |
* Allocation functions * | * Allocation functions * |
* * | * * |
************************************************************************/ |
************************************************************************/ |
static void xmlRelaxNGFreeGrammar(xmlRelaxNGGrammarPtr grammar); |
static void xmlRelaxNGFreeGrammar(xmlRelaxNGGrammarPtr grammar); |
static void xmlRelaxNGFreeDefine(xmlRelaxNGDefinePtr define); |
static void xmlRelaxNGFreeDefine(xmlRelaxNGDefinePtr define); |
Line 1397 xmlRelaxNGFreeValidState(xmlRelaxNGValidCtxtPtr ctxt,
|
Line 1398 xmlRelaxNGFreeValidState(xmlRelaxNGValidCtxtPtr ctxt,
|
} |
} |
|
|
/************************************************************************ |
/************************************************************************ |
* * | * * |
* Semi internal functions * | * Semi internal functions * |
* * | * * |
************************************************************************/ |
************************************************************************/ |
|
|
/** |
/** |
Line 1429 xmlRelaxParserSetFlag(xmlRelaxNGParserCtxtPtr ctxt, in
|
Line 1430 xmlRelaxParserSetFlag(xmlRelaxNGParserCtxtPtr ctxt, in
|
} |
} |
|
|
/************************************************************************ |
/************************************************************************ |
* * | * * |
* Document functions * | * Document functions * |
* * | * * |
************************************************************************/ |
************************************************************************/ |
static xmlDocPtr xmlRelaxNGCleanupDoc(xmlRelaxNGParserCtxtPtr ctxt, |
static xmlDocPtr xmlRelaxNGCleanupDoc(xmlRelaxNGParserCtxtPtr ctxt, |
xmlDocPtr doc); |
xmlDocPtr doc); |
Line 2007 xmlRelaxNGLoadExternalRef(xmlRelaxNGParserCtxtPtr ctxt
|
Line 2008 xmlRelaxNGLoadExternalRef(xmlRelaxNGParserCtxtPtr ctxt
|
} |
} |
|
|
/************************************************************************ |
/************************************************************************ |
* * | * * |
* Error functions * | * Error functions * |
* * | * * |
************************************************************************/ |
************************************************************************/ |
|
|
#define VALID_ERR(a) xmlRelaxNGAddValidError(ctxt, a, NULL, NULL, 0); |
#define VALID_ERR(a) xmlRelaxNGAddValidError(ctxt, a, NULL, NULL, 0); |
Line 2360 xmlRelaxNGAddValidError(xmlRelaxNGValidCtxtPtr ctxt,
|
Line 2361 xmlRelaxNGAddValidError(xmlRelaxNGValidCtxtPtr ctxt,
|
* generate the error directly |
* generate the error directly |
*/ |
*/ |
if (((ctxt->flags & FLAGS_IGNORABLE) == 0) || |
if (((ctxt->flags & FLAGS_IGNORABLE) == 0) || |
(ctxt->flags & FLAGS_NEGATIVE)) { | (ctxt->flags & FLAGS_NEGATIVE)) { |
xmlNodePtr node, seq; |
xmlNodePtr node, seq; |
|
|
/* |
/* |
Line 2390 xmlRelaxNGAddValidError(xmlRelaxNGValidCtxtPtr ctxt,
|
Line 2391 xmlRelaxNGAddValidError(xmlRelaxNGValidCtxtPtr ctxt,
|
|
|
|
|
/************************************************************************ |
/************************************************************************ |
* * | * * |
* Type library hooks * | * Type library hooks * |
* * | * * |
************************************************************************/ |
************************************************************************/ |
static xmlChar *xmlRelaxNGNormalize(xmlRelaxNGValidCtxtPtr ctxt, |
static xmlChar *xmlRelaxNGNormalize(xmlRelaxNGValidCtxtPtr ctxt, |
const xmlChar * str); |
const xmlChar * str); |
Line 2847 xmlRelaxNGCleanupTypes(void)
|
Line 2848 xmlRelaxNGCleanupTypes(void)
|
} |
} |
|
|
/************************************************************************ |
/************************************************************************ |
* * | * * |
* Compiling element content into regexp * | * Compiling element content into regexp * |
* * | * * |
* Sometime the element content can be compiled into a pure regexp, * |
* Sometime the element content can be compiled into a pure regexp, * |
* This allows a faster execution and streamability at that level * |
* This allows a faster execution and streamability at that level * |
* * | * * |
************************************************************************/ |
************************************************************************/ |
|
|
/* from automata.c but not exported */ |
/* from automata.c but not exported */ |
Line 3325 xmlRelaxNGTryCompile(xmlRelaxNGParserCtxtPtr ctxt, xml
|
Line 3326 xmlRelaxNGTryCompile(xmlRelaxNGParserCtxtPtr ctxt, xml
|
} |
} |
|
|
/************************************************************************ |
/************************************************************************ |
* * | * * |
* Parsing functions * | * Parsing functions * |
* * | * * |
************************************************************************/ |
************************************************************************/ |
|
|
static xmlRelaxNGDefinePtr xmlRelaxNGParseAttribute(xmlRelaxNGParserCtxtPtr |
static xmlRelaxNGDefinePtr xmlRelaxNGParseAttribute(xmlRelaxNGParserCtxtPtr |
Line 6705 xmlRelaxNGParseDocument(xmlRelaxNGParserCtxtPtr ctxt,
|
Line 6706 xmlRelaxNGParseDocument(xmlRelaxNGParserCtxtPtr ctxt,
|
} |
} |
|
|
/************************************************************************ |
/************************************************************************ |
* * | * * |
* Reading RelaxNGs * | * Reading RelaxNGs * |
* * | * * |
************************************************************************/ |
************************************************************************/ |
|
|
/** |
/** |
Line 7521 xmlRelaxNGParse(xmlRelaxNGParserCtxtPtr ctxt)
|
Line 7522 xmlRelaxNGParse(xmlRelaxNGParserCtxtPtr ctxt)
|
xmlRngPErr(ctxt, (xmlNodePtr) doc, |
xmlRngPErr(ctxt, (xmlNodePtr) doc, |
XML_RNGP_EMPTY, "xmlRelaxNGParse: %s is empty\n", |
XML_RNGP_EMPTY, "xmlRelaxNGParse: %s is empty\n", |
(ctxt->URL ? ctxt->URL : BAD_CAST "schemas"), NULL); |
(ctxt->URL ? ctxt->URL : BAD_CAST "schemas"), NULL); |
| |
xmlFreeDoc(ctxt->document); |
xmlFreeDoc(ctxt->document); |
ctxt->document = NULL; |
ctxt->document = NULL; |
return (NULL); |
return (NULL); |
Line 7663 xmlRelaxNGSetParserStructuredErrors(xmlRelaxNGParserCt
|
Line 7664 xmlRelaxNGSetParserStructuredErrors(xmlRelaxNGParserCt
|
#ifdef LIBXML_OUTPUT_ENABLED |
#ifdef LIBXML_OUTPUT_ENABLED |
|
|
/************************************************************************ |
/************************************************************************ |
* * | * * |
* Dump back a compiled form * | * Dump back a compiled form * |
* * | * * |
************************************************************************/ |
************************************************************************/ |
static void xmlRelaxNGDumpDefine(FILE * output, |
static void xmlRelaxNGDumpDefine(FILE * output, |
xmlRelaxNGDefinePtr define); |
xmlRelaxNGDefinePtr define); |
Line 7806 xmlRelaxNGDumpDefine(FILE * output, xmlRelaxNGDefinePt
|
Line 7807 xmlRelaxNGDumpDefine(FILE * output, xmlRelaxNGDefinePt
|
* xmlRelaxNGDumpGrammar: |
* xmlRelaxNGDumpGrammar: |
* @output: the file output |
* @output: the file output |
* @grammar: a grammar structure |
* @grammar: a grammar structure |
* @top: is this a top grammar | * @top: is this a top grammar |
* |
* |
* Dump a RelaxNG structure back |
* Dump a RelaxNG structure back |
*/ |
*/ |
Line 7899 xmlRelaxNGDumpTree(FILE * output, xmlRelaxNGPtr schema
|
Line 7900 xmlRelaxNGDumpTree(FILE * output, xmlRelaxNGPtr schema
|
#endif /* LIBXML_OUTPUT_ENABLED */ |
#endif /* LIBXML_OUTPUT_ENABLED */ |
|
|
/************************************************************************ |
/************************************************************************ |
* * | * * |
* Validation of compiled content * | * Validation of compiled content * |
* * | * * |
************************************************************************/ |
************************************************************************/ |
static int xmlRelaxNGValidateDefinition(xmlRelaxNGValidCtxtPtr ctxt, |
static int xmlRelaxNGValidateDefinition(xmlRelaxNGValidCtxtPtr ctxt, |
xmlRelaxNGDefinePtr define); |
xmlRelaxNGDefinePtr define); |
Line 8044 xmlRelaxNGValidateCompiledContent(xmlRelaxNGValidCtxtP
|
Line 8045 xmlRelaxNGValidateCompiledContent(xmlRelaxNGValidCtxtP
|
} |
} |
|
|
/************************************************************************ |
/************************************************************************ |
* * | * * |
* Progressive validation of when possible * | * Progressive validation of when possible * |
* * | * * |
************************************************************************/ |
************************************************************************/ |
static int xmlRelaxNGValidateAttributeList(xmlRelaxNGValidCtxtPtr ctxt, |
static int xmlRelaxNGValidateAttributeList(xmlRelaxNGValidCtxtPtr ctxt, |
xmlRelaxNGDefinePtr defines); |
xmlRelaxNGDefinePtr defines); |
Line 8346 xmlRelaxNGValidatePushElement(xmlRelaxNGValidCtxtPtr c
|
Line 8347 xmlRelaxNGValidatePushElement(xmlRelaxNGValidCtxtPtr c
|
* xmlRelaxNGValidatePushCData: |
* xmlRelaxNGValidatePushCData: |
* @ctxt: the RelaxNG validation context |
* @ctxt: the RelaxNG validation context |
* @data: some character data read |
* @data: some character data read |
* @len: the lenght of the data | * @len: the length of the data |
* |
* |
* check the CData parsed for validation in the current stack |
* check the CData parsed for validation in the current stack |
* |
* |
Line 8480 xmlRelaxNGValidateFullElement(xmlRelaxNGValidCtxtPtr c
|
Line 8481 xmlRelaxNGValidateFullElement(xmlRelaxNGValidCtxtPtr c
|
} |
} |
|
|
/************************************************************************ |
/************************************************************************ |
* * | * * |
* Generic interpreted validation implementation * | * Generic interpreted validation implementation * |
* * | * * |
************************************************************************/ |
************************************************************************/ |
static int xmlRelaxNGValidateValue(xmlRelaxNGValidCtxtPtr ctxt, |
static int xmlRelaxNGValidateValue(xmlRelaxNGValidCtxtPtr ctxt, |
xmlRelaxNGDefinePtr define); |
xmlRelaxNGDefinePtr define); |
Line 10842 xmlRelaxNGCleanPSVI(xmlNodePtr node) {
|
Line 10843 xmlRelaxNGCleanPSVI(xmlNodePtr node) {
|
return; |
return; |
} |
} |
/************************************************************************ |
/************************************************************************ |
* * | * * |
* Validation interfaces * | * Validation interfaces * |
* * | * * |
************************************************************************/ |
************************************************************************/ |
|
|
/** |
/** |