From 419a7688d01dbd4f4234da6bcc57688ae2bb7a4c Mon Sep 17 00:00:00 2001 From: Daniel Veillard Date: Mon, 3 Feb 2003 23:22:49 +0000 Subject: [PATCH] more work on grammars and refs/defs augmented/updated the regression tests * relaxng: more work on grammars and refs/defs * test/relaxng/* result/relaxng/*: augmented/updated the regression tests Daniel --- ChangeLog | 6 + relaxng.c | 231 +++++++++++++++++++++++---------- result/relaxng/tutor10_1_4.err | 4 +- result/relaxng/tutor10_1_5.err | 4 +- result/relaxng/tutor10_1_6.err | 4 +- result/relaxng/tutor10_2_3.err | 4 +- result/relaxng/tutor10_2_4.err | 4 +- result/relaxng/tutor10_7_3.err | 2 +- result/relaxng/tutor10_8_3.err | 2 +- result/relaxng/tutor11_2_2.err | 2 +- result/relaxng/tutor11_2_3.err | 2 +- result/relaxng/tutor11_3_1 | 1 + result/relaxng/tutor11_3_1.err | 3 + result/relaxng/tutor11_4_1 | 1 + result/relaxng/tutor11_4_1.err | 4 + result/relaxng/tutor12_1_1 | 1 + result/relaxng/tutor12_1_1.err | 4 + result/relaxng/tutor13_1_1 | 1 + result/relaxng/tutor13_1_1.err | 9 ++ result/relaxng/tutor3_2_1.err | 4 +- result/relaxng/tutor3_5_2.err | 2 +- result/relaxng/tutor5_3_1.err | 2 +- result/relaxng/tutor6_1_3.err | 2 +- result/relaxng/tutor6_2_4.err | 2 +- result/relaxng/tutor6_3_1.err | 2 +- result/relaxng/tutor7_1_2.err | 6 +- result/relaxng/tutor7_1_3.err | 6 +- result/relaxng/tutor7_2_4.err | 4 +- result/relaxng/tutor7_3_4.err | 6 +- result/relaxng/tutor7_3_5.err | 6 +- result/relaxng/tutor8_2_4.err | 2 +- result/relaxng/tutor8_2_5.err | 4 +- result/relaxng/tutor8_2_6.err | 2 +- result/relaxng/tutor9_5_2.err | 2 +- result/relaxng/tutor9_5_3.err | 2 +- result/relaxng/tutor9_6_2.err | 2 +- result/relaxng/tutor9_6_3.err | 2 +- test/relaxng/table.rng | 21 +++ test/relaxng/tutor11_3.rng | 15 +++ test/relaxng/tutor11_3_1.xml | 1 + test/relaxng/tutor11_4.rng | 19 +++ test/relaxng/tutor11_4_1.xml | 1 + test/relaxng/tutor12_1.rng | 13 ++ test/relaxng/tutor12_1_1.xml | 3 + test/relaxng/tutor13_1.rng | 33 +++++ test/relaxng/tutor13_1_1.xml | 12 ++ 46 files changed, 350 insertions(+), 115 deletions(-) create mode 100644 result/relaxng/tutor11_3_1 create mode 100644 result/relaxng/tutor11_3_1.err create mode 100644 result/relaxng/tutor11_4_1 create mode 100644 result/relaxng/tutor11_4_1.err create mode 100644 result/relaxng/tutor12_1_1 create mode 100644 result/relaxng/tutor12_1_1.err create mode 100644 result/relaxng/tutor13_1_1 create mode 100644 result/relaxng/tutor13_1_1.err create mode 100644 test/relaxng/table.rng create mode 100644 test/relaxng/tutor11_3.rng create mode 100644 test/relaxng/tutor11_3_1.xml create mode 100644 test/relaxng/tutor11_4.rng create mode 100644 test/relaxng/tutor11_4_1.xml create mode 100644 test/relaxng/tutor12_1.rng create mode 100644 test/relaxng/tutor12_1_1.xml create mode 100644 test/relaxng/tutor13_1.rng create mode 100644 test/relaxng/tutor13_1_1.xml diff --git a/ChangeLog b/ChangeLog index 1bb3c4cb..09e7b4db 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Tue Feb 4 00:20:58 CET 2003 Daniel Veillard + + * relaxng: more work on grammars and refs/defs + * test/relaxng/* result/relaxng/*: augmented/updated the + regression tests + Mon Feb 3 14:16:59 CET 2003 Daniel Veillard * relaxng: more work on name classes, except support diff --git a/relaxng.c b/relaxng.c index c6953c7b..ab25bffb 100644 --- a/relaxng.c +++ b/relaxng.c @@ -105,6 +105,7 @@ typedef enum { XML_RELAXNG_DEF, /* a definition */ XML_RELAXNG_REF, /* reference to a definition */ XML_RELAXNG_EXTERNALREF, /* reference to an external def */ + XML_RELAXNG_PARENTREF, /* reference to a def in the parent grammar */ XML_RELAXNG_OPTIONAL, /* optional patterns */ XML_RELAXNG_ZEROORMORE, /* zero or more non empty patterns */ XML_RELAXNG_ONEORMORE, /* one or more non empty patterns */ @@ -140,8 +141,10 @@ struct _xmlRelaxNG { xmlHashTablePtr defs; /* define */ xmlHashTablePtr refs; /* references */ - xmlHashTablePtr documents; /* all the documents loaded */ - xmlHashTablePtr includes; /* all the includes loaded */ + xmlHashTablePtr documents; /* all the documents loaded */ + xmlHashTablePtr includes; /* all the includes loaded */ + int defNr; /* number of defines used */ + xmlRelaxNGDefinePtr *defTab;/* pointer to the allocated definitions */ void *_private; /* unused by the library for users or bindings */ }; @@ -161,6 +164,7 @@ struct _xmlRelaxNGParserCtxt { xmlRelaxNGPtr schema; /* The schema in use */ xmlRelaxNGGrammarPtr grammar; /* the current grammar */ + xmlRelaxNGGrammarPtr parentgrammar;/* the parent grammar */ int flags; /* parser flags */ int nbErrors; /* number of errors at parse time */ int nbWarnings; /* number of warnings at parse time */ @@ -175,6 +179,10 @@ struct _xmlRelaxNGParserCtxt { xmlChar *URL; xmlDocPtr document; + int defNr; /* number of defines used */ + int defMax; /* number of defines aloocated */ + xmlRelaxNGDefinePtr *defTab; /* pointer to the allocated definitions */ + const char *buffer; int size; @@ -337,7 +345,6 @@ struct _xmlRelaxNGTypeLibrary { * Allocation functions * * * ************************************************************************/ -static void xmlRelaxNGFreeDefineList(xmlRelaxNGDefinePtr defines); static void xmlRelaxNGFreeGrammar(xmlRelaxNGGrammarPtr grammar); static void xmlRelaxNGFreeDefine(xmlRelaxNGDefinePtr define); @@ -430,6 +437,13 @@ xmlRelaxNGFree(xmlRelaxNGPtr schema) if (schema->includes != NULL) xmlHashFree(schema->includes, (xmlHashDeallocator) xmlRelaxNGFreeInclude); + if (schema->defTab != NULL) { + int i; + + for (i = 0;i < schema->defNr;i++) + xmlRelaxNGFreeDefine(schema->defTab[i]); + xmlFree(schema->defTab); + } xmlFree(schema); } @@ -459,24 +473,6 @@ xmlRelaxNGNewGrammar(xmlRelaxNGParserCtxtPtr ctxt) return (ret); } -/** - * xmlRelaxNGFreeDefineHash: - * @defines: a list of define structures - * - * Deallocate a RelaxNG definition in the hash table - */ -static void -xmlRelaxNGFreeDefineHash(xmlRelaxNGDefinePtr defines) -{ - xmlRelaxNGDefinePtr next; - - while (defines != NULL) { - next = defines->nextHash; - xmlRelaxNGFreeDefine(defines); - defines = next; - } -} - /** * xmlRelaxNGFreeGrammar: * @grammar: a grammar structure @@ -489,14 +485,14 @@ xmlRelaxNGFreeGrammar(xmlRelaxNGGrammarPtr grammar) if (grammar == NULL) return; - if (grammar->start != NULL) - xmlRelaxNGFreeDefine(grammar->start); + if (grammar->next != NULL) { + xmlRelaxNGFreeGrammar(grammar->next); + } if (grammar->refs != NULL) { xmlHashFree(grammar->refs, NULL); } if (grammar->defs != NULL) { - xmlHashFree(grammar->defs, (xmlHashDeallocator) - xmlRelaxNGFreeDefineHash); + xmlHashFree(grammar->defs, NULL); } xmlFree(grammar); @@ -516,37 +512,43 @@ xmlRelaxNGNewDefine(xmlRelaxNGParserCtxtPtr ctxt, xmlNodePtr node) { xmlRelaxNGDefinePtr ret; + if (ctxt->defMax == 0) { + ctxt->defMax = 16; + ctxt->defNr = 0; + ctxt->defTab = (xmlRelaxNGDefinePtr *) + xmlMalloc(ctxt->defMax * sizeof(xmlRelaxNGDefinePtr)); + if (ctxt->defTab == NULL) { + if ((ctxt != NULL) && (ctxt->error != NULL)) + ctxt->error(ctxt->userData, "Out of memory\n"); + ctxt->nbErrors++; + return (NULL); + } + } else if (ctxt->defMax <= ctxt->defNr) { + xmlRelaxNGDefinePtr *tmp; + ctxt->defMax *= 2; + tmp = (xmlRelaxNGDefinePtr *) xmlRealloc(ctxt->defTab, + ctxt->defMax * sizeof(xmlRelaxNGDefinePtr)); + if (tmp == NULL) { + if ((ctxt != NULL) && (ctxt->error != NULL)) + ctxt->error(ctxt->userData, "Out of memory\n"); + ctxt->nbErrors++; + return (NULL); + } + ctxt->defTab = tmp; + } ret = (xmlRelaxNGDefinePtr) xmlMalloc(sizeof(xmlRelaxNGDefine)); if (ret == NULL) { - if ((ctxt != NULL) && (ctxt->error != NULL)) - ctxt->error(ctxt->userData, "Out of memory\n"); + if ((ctxt != NULL) && (ctxt->error != NULL)) + ctxt->error(ctxt->userData, "Out of memory\n"); ctxt->nbErrors++; - return (NULL); + return(NULL); } memset(ret, 0, sizeof(xmlRelaxNGDefine)); + ctxt->defTab[ctxt->defNr++] = ret; ret->node = node; - return (ret); } -/** - * xmlRelaxNGFreeDefineList: - * @defines: a list of define structures - * - * Deallocate a RelaxNG define structures. - */ -static void -xmlRelaxNGFreeDefineList(xmlRelaxNGDefinePtr defines) -{ - xmlRelaxNGDefinePtr next; - - while (defines != NULL) { - next = defines->next; - xmlRelaxNGFreeDefine(defines); - defines = next; - } -} - /** * xmlRelaxNGFreePartition: * @partitions: a partition set structure @@ -585,23 +587,15 @@ xmlRelaxNGFreeDefine(xmlRelaxNGDefinePtr define) if (define == NULL) return; + if ((define->data != NULL) && + (define->type == XML_RELAXNG_INTERLEAVE)) + xmlRelaxNGFreePartition((xmlRelaxNGPartitionPtr) define->data); if (define->name != NULL) xmlFree(define->name); if (define->ns != NULL) xmlFree(define->ns); if (define->value != NULL) xmlFree(define->value); - if (define->attrs != NULL) - xmlRelaxNGFreeDefineList(define->attrs); - if ((define->content != NULL) && - (define->type != XML_RELAXNG_REF) && - (define->type != XML_RELAXNG_EXTERNALREF)) - xmlRelaxNGFreeDefineList(define->content); - if (define->nameClass != NULL) - xmlRelaxNGFreeDefineList(define->nameClass); - if ((define->data != NULL) && - (define->type == XML_RELAXNG_INTERLEAVE)) - xmlRelaxNGFreePartition((xmlRelaxNGPartitionPtr) define->data); xmlFree(define); } @@ -1572,6 +1566,8 @@ static int xmlRelaxNGParseGrammarContent( static xmlRelaxNGDefinePtr xmlRelaxNGParseNameClass( xmlRelaxNGParserCtxtPtr ctxt, xmlNodePtr node, xmlRelaxNGDefinePtr def); +static xmlRelaxNGGrammarPtr xmlRelaxNGParseGrammar( + xmlRelaxNGParserCtxtPtr ctxt, xmlNodePtr nodes); #define IS_BLANK_NODE(n) \ @@ -2202,7 +2198,6 @@ xmlRelaxNGParseDefine(xmlRelaxNGParserCtxtPtr ctxt, xmlNodePtr node) { "Could not create definition hash\n"); ctxt->nbErrors++; ret = -1; - xmlRelaxNGFreeDefine(def); } else { tmp = xmlHashAddEntry(ctxt->grammar->defs, name, def); if (tmp < 0) { @@ -2216,7 +2211,6 @@ xmlRelaxNGParseDefine(xmlRelaxNGParserCtxtPtr ctxt, xmlNodePtr node) { name); ctxt->nbErrors++; ret = -1; - xmlRelaxNGFreeDefine(def); } else { while (prev->nextHash != NULL) prev = prev->nextHash; @@ -2325,7 +2319,6 @@ xmlRelaxNGParsePattern(xmlRelaxNGParserCtxtPtr ctxt, xmlNodePtr node) { ctxt->error(ctxt->userData, "Could not create references hash\n"); ctxt->nbErrors++; - xmlRelaxNGFreeDefine(def); def = NULL; } else { int tmp; @@ -2342,7 +2335,6 @@ xmlRelaxNGParsePattern(xmlRelaxNGParserCtxtPtr ctxt, xmlNodePtr node) { "Internal error refs definitions '%s'\n", def->name); ctxt->nbErrors++; - xmlRelaxNGFreeDefine(def); def = NULL; } else { def->nextHash = prev->nextHash; @@ -2410,6 +2402,81 @@ xmlRelaxNGParsePattern(xmlRelaxNGParserCtxtPtr ctxt, xmlNodePtr node) { "xmlRelaxNGParse: notAllowed element is not empty\n"); ctxt->nbErrors++; } + } else if (IS_RELAXNG(node, "grammar")) { + xmlRelaxNGGrammarPtr grammar, old; + xmlRelaxNGGrammarPtr oldparent; + + oldparent = ctxt->parentgrammar; + old = ctxt->grammar; + ctxt->parentgrammar = old; + grammar = xmlRelaxNGParseGrammar(ctxt, node->children); + if (old != NULL) { + ctxt->grammar = old; + ctxt->parentgrammar = oldparent; + if (grammar != NULL) { + grammar->next = old->next; + old->next = grammar; + } + } + if (grammar != NULL) + def = grammar->start; + else + def = NULL; + } else if (IS_RELAXNG(node, "parentRef")) { + if (ctxt->parentgrammar == NULL) { + if (ctxt->error != NULL) + ctxt->error(ctxt->userData, + "Use of parentRef without a parent grammar\n"); + ctxt->nbErrors++; + return(NULL); + } + def = xmlRelaxNGNewDefine(ctxt, node); + if (def == NULL) + return(NULL); + def->type = XML_RELAXNG_PARENTREF; + def->name = xmlGetProp(node, BAD_CAST "name"); + if (def->name == NULL) { + if (ctxt->error != NULL) + ctxt->error(ctxt->userData, + "parentRef has no name\n"); + ctxt->nbErrors++; + } + if (node->children != NULL) { + if (ctxt->error != NULL) + ctxt->error(ctxt->userData, + "parentRef is not empty\n"); + ctxt->nbErrors++; + } + if (ctxt->parentgrammar->refs == NULL) + ctxt->parentgrammar->refs = xmlHashCreate(10); + if (ctxt->parentgrammar->refs == NULL) { + if (ctxt->error != NULL) + ctxt->error(ctxt->userData, + "Could not create references hash\n"); + ctxt->nbErrors++; + def = NULL; + } else { + int tmp; + + tmp = xmlHashAddEntry(ctxt->parentgrammar->refs, def->name, def); + if (tmp < 0) { + xmlRelaxNGDefinePtr prev; + + prev = (xmlRelaxNGDefinePtr) + xmlHashLookup(ctxt->parentgrammar->refs, def->name); + if (prev == NULL) { + if (ctxt->error != NULL) + ctxt->error(ctxt->userData, + "Internal error parentRef definitions '%s'\n", + def->name); + ctxt->nbErrors++; + def = NULL; + } else { + def->nextHash = prev->nextHash; + prev->nextHash = def; + } + } + } } else { TODO def = NULL; @@ -2465,6 +2532,7 @@ xmlRelaxNGParseAttribute(xmlRelaxNGParserCtxtPtr ctxt, xmlNodePtr node) { case XML_RELAXNG_VALUE: case XML_RELAXNG_LIST: case XML_RELAXNG_REF: + case XML_RELAXNG_PARENTREF: case XML_RELAXNG_EXTERNALREF: case XML_RELAXNG_DEF: case XML_RELAXNG_ONEORMORE: @@ -2547,9 +2615,7 @@ xmlRelaxNGParseExceptNameClass(xmlRelaxNGParserCtxtPtr ctxt, else cur->type = XML_RELAXNG_ELEMENT; - if (xmlRelaxNGParseNameClass(ctxt, child, cur) == NULL) { - xmlRelaxNGFreeDefine(cur); - } else { + if (xmlRelaxNGParseNameClass(ctxt, child, cur) != NULL) { if (last == NULL) { ret->content = cur; } else { @@ -2674,6 +2740,7 @@ xmlRelaxNGParseElement(xmlRelaxNGParserCtxtPtr ctxt, xmlNodePtr node) { case XML_RELAXNG_VALUE: case XML_RELAXNG_LIST: case XML_RELAXNG_REF: + case XML_RELAXNG_PARENTREF: case XML_RELAXNG_EXTERNALREF: case XML_RELAXNG_DEF: case XML_RELAXNG_ZEROORMORE: @@ -2749,13 +2816,14 @@ xmlRelaxNGParsePatterns(xmlRelaxNGParserCtxtPtr ctxt, xmlNodePtr nodes, cur->parent = parent; } else { cur = xmlRelaxNGParsePattern(ctxt, nodes); - if (def == NULL) { - def = last = cur; - } else { - last->next = cur; - last = cur; + if (cur != NULL) { + if (def == NULL) { + def = last = cur; + } else { + last->next = cur; + last = cur; + } } - cur->parent = parent; } nodes = nodes->next; } @@ -3321,6 +3389,13 @@ xmlRelaxNGFreeParserCtxt(xmlRelaxNGParserCtxtPtr ctxt) { xmlFree(ctxt->docTab); if (ctxt->incTab != NULL) xmlFree(ctxt->incTab); + if (ctxt->defTab != NULL) { + int i; + + for (i = 0;i < ctxt->defNr;i++) + xmlRelaxNGFreeDefine(ctxt->defTab[i]); + xmlFree(ctxt->defTab); + } xmlFree(ctxt); } @@ -3746,6 +3821,9 @@ xmlRelaxNGParse(xmlRelaxNGParserCtxtPtr ctxt) ctxt->documents = NULL; ret->includes = ctxt->includes; ctxt->includes = NULL; + ret->defNr = ctxt->defNr; + ret->defTab = ctxt->defTab; + ctxt->defTab = NULL; return (ret); } @@ -3880,6 +3958,14 @@ xmlRelaxNGDumpDefine(FILE * output, xmlRelaxNGDefinePtr define) { xmlRelaxNGDumpDefines(output, define->content); fprintf(output, "\n"); break; + case XML_RELAXNG_PARENTREF: + fprintf(output, "name != NULL) + fprintf(output, " name=\"%s\"", define->name); + fprintf(output, ">\n"); + xmlRelaxNGDumpDefines(output, define->content); + fprintf(output, "\n"); + break; case XML_RELAXNG_EXTERNALREF: fprintf(output, "content); @@ -5081,8 +5167,9 @@ xmlRelaxNGValidateDefinition(xmlRelaxNGValidCtxtPtr ctxt, case XML_RELAXNG_ATTRIBUTE: ret = xmlRelaxNGValidateAttribute(ctxt, define); break; - case XML_RELAXNG_EXTERNALREF: case XML_RELAXNG_REF: + case XML_RELAXNG_PARENTREF: + case XML_RELAXNG_EXTERNALREF: ret = xmlRelaxNGValidateDefinition(ctxt, define->content); break; case XML_RELAXNG_DATATYPE: { diff --git a/result/relaxng/tutor10_1_4.err b/result/relaxng/tutor10_1_4.err index f44dee75..3027e8ed 100644 --- a/result/relaxng/tutor10_1_4.err +++ b/result/relaxng/tutor10_1_4.err @@ -1,2 +1,2 @@ -error detected at relaxng.c:4920 -error detected at relaxng.c:5223 +error detected at relaxng.c:5006 +error detected at relaxng.c:5310 diff --git a/result/relaxng/tutor10_1_5.err b/result/relaxng/tutor10_1_5.err index 485b5f90..044426ce 100644 --- a/result/relaxng/tutor10_1_5.err +++ b/result/relaxng/tutor10_1_5.err @@ -1,2 +1,2 @@ -error detected at relaxng.c:4925 -error detected at relaxng.c:5223 +error detected at relaxng.c:5011 +error detected at relaxng.c:5310 diff --git a/result/relaxng/tutor10_1_6.err b/result/relaxng/tutor10_1_6.err index 485b5f90..044426ce 100644 --- a/result/relaxng/tutor10_1_6.err +++ b/result/relaxng/tutor10_1_6.err @@ -1,2 +1,2 @@ -error detected at relaxng.c:4925 -error detected at relaxng.c:5223 +error detected at relaxng.c:5011 +error detected at relaxng.c:5310 diff --git a/result/relaxng/tutor10_2_3.err b/result/relaxng/tutor10_2_3.err index df2b5542..ae9e6688 100644 --- a/result/relaxng/tutor10_2_3.err +++ b/result/relaxng/tutor10_2_3.err @@ -1,2 +1,2 @@ -error detected at relaxng.c:4932 -error detected at relaxng.c:5223 +error detected at relaxng.c:5018 +error detected at relaxng.c:5310 diff --git a/result/relaxng/tutor10_2_4.err b/result/relaxng/tutor10_2_4.err index df2b5542..ae9e6688 100644 --- a/result/relaxng/tutor10_2_4.err +++ b/result/relaxng/tutor10_2_4.err @@ -1,2 +1,2 @@ -error detected at relaxng.c:4932 -error detected at relaxng.c:5223 +error detected at relaxng.c:5018 +error detected at relaxng.c:5310 diff --git a/result/relaxng/tutor10_7_3.err b/result/relaxng/tutor10_7_3.err index e6e8943a..22961563 100644 --- a/result/relaxng/tutor10_7_3.err +++ b/result/relaxng/tutor10_7_3.err @@ -1,5 +1,5 @@ xmlRelaxNGValidateAttribute(email): -1 xmlRelaxNGValidateAttribute(name): -1 xmlRelaxNGValidateDefinition(): validated card : -1 -error detected at relaxng.c:4960 +error detected at relaxng.c:5046 xmlRelaxNGValidateDefinition(): validated addressBook : -1 diff --git a/result/relaxng/tutor10_8_3.err b/result/relaxng/tutor10_8_3.err index e6e8943a..22961563 100644 --- a/result/relaxng/tutor10_8_3.err +++ b/result/relaxng/tutor10_8_3.err @@ -1,5 +1,5 @@ xmlRelaxNGValidateAttribute(email): -1 xmlRelaxNGValidateAttribute(name): -1 xmlRelaxNGValidateDefinition(): validated card : -1 -error detected at relaxng.c:4960 +error detected at relaxng.c:5046 xmlRelaxNGValidateDefinition(): validated addressBook : -1 diff --git a/result/relaxng/tutor11_2_2.err b/result/relaxng/tutor11_2_2.err index e7c8b3b3..c1dc05ac 100644 --- a/result/relaxng/tutor11_2_2.err +++ b/result/relaxng/tutor11_2_2.err @@ -1,4 +1,4 @@ xmlRelaxNGValidateAttribute(anyName): 0 xmlRelaxNGValidateAttribute(anyName): -1 -error detected at relaxng.c:4968 +error detected at relaxng.c:5054 xmlRelaxNGValidateDefinition(): validated card : -1 diff --git a/result/relaxng/tutor11_2_3.err b/result/relaxng/tutor11_2_3.err index e7c8b3b3..c1dc05ac 100644 --- a/result/relaxng/tutor11_2_3.err +++ b/result/relaxng/tutor11_2_3.err @@ -1,4 +1,4 @@ xmlRelaxNGValidateAttribute(anyName): 0 xmlRelaxNGValidateAttribute(anyName): -1 -error detected at relaxng.c:4968 +error detected at relaxng.c:5054 xmlRelaxNGValidateDefinition(): validated card : -1 diff --git a/result/relaxng/tutor11_3_1 b/result/relaxng/tutor11_3_1 new file mode 100644 index 00000000..83963d8d --- /dev/null +++ b/result/relaxng/tutor11_3_1 @@ -0,0 +1 @@ +./test/relaxng/tutor11_3_1.xml validates diff --git a/result/relaxng/tutor11_3_1.err b/result/relaxng/tutor11_3_1.err new file mode 100644 index 00000000..b9c253eb --- /dev/null +++ b/result/relaxng/tutor11_3_1.err @@ -0,0 +1,3 @@ +xmlRelaxNGValidateAttribute(anyName): 0 +xmlRelaxNGValidateAttribute(anyName): 0 +xmlRelaxNGValidateDefinition(): validated example : 0 diff --git a/result/relaxng/tutor11_4_1 b/result/relaxng/tutor11_4_1 new file mode 100644 index 00000000..16aed5cc --- /dev/null +++ b/result/relaxng/tutor11_4_1 @@ -0,0 +1 @@ +./test/relaxng/tutor11_4_1.xml validates diff --git a/result/relaxng/tutor11_4_1.err b/result/relaxng/tutor11_4_1.err new file mode 100644 index 00000000..3897976e --- /dev/null +++ b/result/relaxng/tutor11_4_1.err @@ -0,0 +1,4 @@ +xmlRelaxNGValidateAttribute(anyName): 0 +xmlRelaxNGValidateAttribute(anyName): -1 +xmlRelaxNGValidateAttribute(space): 0 +xmlRelaxNGValidateDefinition(): validated example : 0 diff --git a/result/relaxng/tutor12_1_1 b/result/relaxng/tutor12_1_1 new file mode 100644 index 00000000..aab20d34 --- /dev/null +++ b/result/relaxng/tutor12_1_1 @@ -0,0 +1 @@ +./test/relaxng/tutor12_1_1.xml validates diff --git a/result/relaxng/tutor12_1_1.err b/result/relaxng/tutor12_1_1.err new file mode 100644 index 00000000..b6733d4b --- /dev/null +++ b/result/relaxng/tutor12_1_1.err @@ -0,0 +1,4 @@ +xmlRelaxNGValidateDefinition(): validated name : 0 +xmlRelaxNGValidateDefinition(): validated email : 0 +xmlRelaxNGValidateDefinition(): validated card : 0 +xmlRelaxNGValidateDefinition(): validated addressBook : 0 diff --git a/result/relaxng/tutor13_1_1 b/result/relaxng/tutor13_1_1 new file mode 100644 index 00000000..3a3f2aeb --- /dev/null +++ b/result/relaxng/tutor13_1_1 @@ -0,0 +1 @@ +./test/relaxng/tutor13_1_1.xml validates diff --git a/result/relaxng/tutor13_1_1.err b/result/relaxng/tutor13_1_1.err new file mode 100644 index 00000000..d23763b8 --- /dev/null +++ b/result/relaxng/tutor13_1_1.err @@ -0,0 +1,9 @@ +xmlRelaxNGValidateDefinition(): validated p : 0 +xmlRelaxNGValidateDefinition(): validated em : 0 +xmlRelaxNGValidateDefinition(): validated td : 0 +xmlRelaxNGValidateDefinition(): validated tr : 0 +xmlRelaxNGValidateDefinition(): validated td : 0 +xmlRelaxNGValidateDefinition(): validated tr : 0 +xmlRelaxNGValidateDefinition(): validated table : 0 +xmlRelaxNGValidateDefinition(): validated p : 0 +xmlRelaxNGValidateDefinition(): validated doc : 0 diff --git a/result/relaxng/tutor3_2_1.err b/result/relaxng/tutor3_2_1.err index 57dfd099..01ec15f4 100644 --- a/result/relaxng/tutor3_2_1.err +++ b/result/relaxng/tutor3_2_1.err @@ -1,3 +1,3 @@ -error detected at relaxng.c:4912 -error detected at relaxng.c:4960 +error detected at relaxng.c:4998 +error detected at relaxng.c:5046 xmlRelaxNGValidateDefinition(): validated card : -1 diff --git a/result/relaxng/tutor3_5_2.err b/result/relaxng/tutor3_5_2.err index 64104fcb..d21e17ec 100644 --- a/result/relaxng/tutor3_5_2.err +++ b/result/relaxng/tutor3_5_2.err @@ -1,4 +1,4 @@ xmlRelaxNGValidateDefinition(): validated email : 0 xmlRelaxNGValidateDefinition(): validated card : -1 -error detected at relaxng.c:4960 +error detected at relaxng.c:5046 xmlRelaxNGValidateDefinition(): validated addressBook : -1 diff --git a/result/relaxng/tutor5_3_1.err b/result/relaxng/tutor5_3_1.err index cbe216a5..6f62fd3b 100644 --- a/result/relaxng/tutor5_3_1.err +++ b/result/relaxng/tutor5_3_1.err @@ -1,3 +1,3 @@ -error detected at relaxng.c:5105 +error detected at relaxng.c:5192 xmlRelaxNGValidateDefinition(): validated note : 0 xmlRelaxNGValidateDefinition(): validated bad : -1 diff --git a/result/relaxng/tutor6_1_3.err b/result/relaxng/tutor6_1_3.err index 079f7f12..3fbb8172 100644 --- a/result/relaxng/tutor6_1_3.err +++ b/result/relaxng/tutor6_1_3.err @@ -1,5 +1,5 @@ xmlRelaxNGValidateAttribute(preferredFormat): -1 xmlRelaxNGValidateAttribute(email): 0 xmlRelaxNGValidateAttribute(name): 0 -error detected at relaxng.c:4968 +error detected at relaxng.c:5054 xmlRelaxNGValidateDefinition(): validated card : -1 diff --git a/result/relaxng/tutor6_2_4.err b/result/relaxng/tutor6_2_4.err index ad2cde70..ecf180e2 100644 --- a/result/relaxng/tutor6_2_4.err +++ b/result/relaxng/tutor6_2_4.err @@ -1,5 +1,5 @@ xmlRelaxNGValidateDefinition(): validated name : 0 xmlRelaxNGValidateDefinition(): validated email : 0 -error detected at relaxng.c:4960 +error detected at relaxng.c:5046 xmlRelaxNGValidateDefinition(): validated preferredFormat : -1 xmlRelaxNGValidateDefinition(): validated card : -1 diff --git a/result/relaxng/tutor6_3_1.err b/result/relaxng/tutor6_3_1.err index 079f7f12..3fbb8172 100644 --- a/result/relaxng/tutor6_3_1.err +++ b/result/relaxng/tutor6_3_1.err @@ -1,5 +1,5 @@ xmlRelaxNGValidateAttribute(preferredFormat): -1 xmlRelaxNGValidateAttribute(email): 0 xmlRelaxNGValidateAttribute(name): 0 -error detected at relaxng.c:4968 +error detected at relaxng.c:5054 xmlRelaxNGValidateDefinition(): validated card : -1 diff --git a/result/relaxng/tutor7_1_2.err b/result/relaxng/tutor7_1_2.err index b401034b..f4606085 100644 --- a/result/relaxng/tutor7_1_2.err +++ b/result/relaxng/tutor7_1_2.err @@ -1,5 +1,5 @@ Unimplemented block at xmlschemastypes.c:1132 -error detected at relaxng.c:4078 -error detected at relaxng.c:5159 -error detected at relaxng.c:4960 +error detected at relaxng.c:4164 +error detected at relaxng.c:5246 +error detected at relaxng.c:5046 xmlRelaxNGValidateDefinition(): validated vector : -1 diff --git a/result/relaxng/tutor7_1_3.err b/result/relaxng/tutor7_1_3.err index ea5baa24..fd341d5a 100644 --- a/result/relaxng/tutor7_1_3.err +++ b/result/relaxng/tutor7_1_3.err @@ -1,6 +1,6 @@ Unimplemented block at xmlschemastypes.c:1132 Unimplemented block at xmlschemastypes.c:1132 -error detected at relaxng.c:4266 -error detected at relaxng.c:5159 -error detected at relaxng.c:4960 +error detected at relaxng.c:4352 +error detected at relaxng.c:5246 +error detected at relaxng.c:5046 xmlRelaxNGValidateDefinition(): validated vector : -1 diff --git a/result/relaxng/tutor7_2_4.err b/result/relaxng/tutor7_2_4.err index 7be81f1c..be2be142 100644 --- a/result/relaxng/tutor7_2_4.err +++ b/result/relaxng/tutor7_2_4.err @@ -1,3 +1,3 @@ -error detected at relaxng.c:4241 -error detected at relaxng.c:5159 +error detected at relaxng.c:4327 +error detected at relaxng.c:5246 xmlRelaxNGValidateDefinition(): validated vector : -1 diff --git a/result/relaxng/tutor7_3_4.err b/result/relaxng/tutor7_3_4.err index 0d0056da..9e911746 100644 --- a/result/relaxng/tutor7_3_4.err +++ b/result/relaxng/tutor7_3_4.err @@ -1,7 +1,7 @@ Unimplemented block at xmlschemastypes.c:1135 Unimplemented block at xmlschemastypes.c:1135 Unimplemented block at xmlschemastypes.c:1135 -error detected at relaxng.c:4266 -error detected at relaxng.c:5159 -error detected at relaxng.c:4960 +error detected at relaxng.c:4352 +error detected at relaxng.c:5246 +error detected at relaxng.c:5046 xmlRelaxNGValidateDefinition(): validated path : -1 diff --git a/result/relaxng/tutor7_3_5.err b/result/relaxng/tutor7_3_5.err index 3d48e842..6a17778c 100644 --- a/result/relaxng/tutor7_3_5.err +++ b/result/relaxng/tutor7_3_5.err @@ -1,5 +1,5 @@ Unimplemented block at xmlschemastypes.c:1135 -error detected at relaxng.c:4078 -error detected at relaxng.c:5159 -error detected at relaxng.c:4960 +error detected at relaxng.c:4164 +error detected at relaxng.c:5246 +error detected at relaxng.c:5046 xmlRelaxNGValidateDefinition(): validated path : -1 diff --git a/result/relaxng/tutor8_2_4.err b/result/relaxng/tutor8_2_4.err index bbea2003..2a455746 100644 --- a/result/relaxng/tutor8_2_4.err +++ b/result/relaxng/tutor8_2_4.err @@ -3,5 +3,5 @@ xmlRelaxNGComputeInterleaves(interleave0) 6 groups xmlRelaxNGValidateDefinition(): validated title : 0 xmlRelaxNGValidateDefinition(): validated title : 0 -error detected at relaxng.c:4960 +error detected at relaxng.c:5046 xmlRelaxNGValidateDefinition(): validated head : -1 diff --git a/result/relaxng/tutor8_2_5.err b/result/relaxng/tutor8_2_5.err index 2a84fea9..6279c932 100644 --- a/result/relaxng/tutor8_2_5.err +++ b/result/relaxng/tutor8_2_5.err @@ -1,6 +1,6 @@ xmlRelaxNGComputeInterleaves(interleave0) 6 child 6 groups -error detected at relaxng.c:4906 -error detected at relaxng.c:4960 +error detected at relaxng.c:4992 +error detected at relaxng.c:5046 xmlRelaxNGValidateDefinition(): validated head : -1 diff --git a/result/relaxng/tutor8_2_6.err b/result/relaxng/tutor8_2_6.err index 0393fd4c..cf9e5231 100644 --- a/result/relaxng/tutor8_2_6.err +++ b/result/relaxng/tutor8_2_6.err @@ -4,5 +4,5 @@ xmlRelaxNGComputeInterleaves(interleave0) xmlRelaxNGValidateDefinition(): validated title : 0 xmlRelaxNGValidateDefinition(): validated base : 0 xmlRelaxNGValidateDefinition(): validated base : 0 -error detected at relaxng.c:4960 +error detected at relaxng.c:5046 xmlRelaxNGValidateDefinition(): validated head : -1 diff --git a/result/relaxng/tutor9_5_2.err b/result/relaxng/tutor9_5_2.err index 3a61ccab..2a51ff0a 100644 --- a/result/relaxng/tutor9_5_2.err +++ b/result/relaxng/tutor9_5_2.err @@ -4,5 +4,5 @@ xmlRelaxNGComputeInterleaves(interleave0) 2 groups xmlRelaxNGValidateAttribute(name): 0 xmlRelaxNGValidateDefinition(): validated card : -1 -error detected at relaxng.c:4960 +error detected at relaxng.c:5046 xmlRelaxNGValidateDefinition(): validated addressBook : -1 diff --git a/result/relaxng/tutor9_5_3.err b/result/relaxng/tutor9_5_3.err index 5dbf9a36..ab16de20 100644 --- a/result/relaxng/tutor9_5_3.err +++ b/result/relaxng/tutor9_5_3.err @@ -5,5 +5,5 @@ xmlRelaxNGComputeInterleaves(interleave0) xmlRelaxNGValidateAttribute(name): 0 xmlRelaxNGValidateAttribute(email): 0 xmlRelaxNGValidateDefinition(): validated card : -1 -error detected at relaxng.c:4960 +error detected at relaxng.c:5046 xmlRelaxNGValidateDefinition(): validated addressBook : -1 diff --git a/result/relaxng/tutor9_6_2.err b/result/relaxng/tutor9_6_2.err index 856cc70a..2b21d7e7 100644 --- a/result/relaxng/tutor9_6_2.err +++ b/result/relaxng/tutor9_6_2.err @@ -1,4 +1,4 @@ xmlRelaxNGValidateAttribute(name): 0 xmlRelaxNGValidateDefinition(): validated card : -1 -error detected at relaxng.c:4960 +error detected at relaxng.c:5046 xmlRelaxNGValidateDefinition(): validated addressBook : -1 diff --git a/result/relaxng/tutor9_6_3.err b/result/relaxng/tutor9_6_3.err index fa908fc1..2cc40f21 100644 --- a/result/relaxng/tutor9_6_3.err +++ b/result/relaxng/tutor9_6_3.err @@ -1,5 +1,5 @@ xmlRelaxNGValidateAttribute(name): 0 xmlRelaxNGValidateAttribute(email): 0 xmlRelaxNGValidateDefinition(): validated card : -1 -error detected at relaxng.c:4960 +error detected at relaxng.c:5046 xmlRelaxNGValidateDefinition(): validated addressBook : -1 diff --git a/test/relaxng/table.rng b/test/relaxng/table.rng new file mode 100644 index 00000000..c14e6030 --- /dev/null +++ b/test/relaxng/table.rng @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/test/relaxng/tutor11_3.rng b/test/relaxng/tutor11_3.rng new file mode 100644 index 00000000..72e041d3 --- /dev/null +++ b/test/relaxng/tutor11_3.rng @@ -0,0 +1,15 @@ + + + + + + + + + + default + preserve + + + + diff --git a/test/relaxng/tutor11_3_1.xml b/test/relaxng/tutor11_3_1.xml new file mode 100644 index 00000000..01b47fcd --- /dev/null +++ b/test/relaxng/tutor11_3_1.xml @@ -0,0 +1 @@ + diff --git a/test/relaxng/tutor11_4.rng b/test/relaxng/tutor11_4.rng new file mode 100644 index 00000000..158c7a5a --- /dev/null +++ b/test/relaxng/tutor11_4.rng @@ -0,0 +1,19 @@ + + + + + + xml:space + + + + + + + + default + preserve + + + + diff --git a/test/relaxng/tutor11_4_1.xml b/test/relaxng/tutor11_4_1.xml new file mode 100644 index 00000000..01b47fcd --- /dev/null +++ b/test/relaxng/tutor11_4_1.xml @@ -0,0 +1 @@ + diff --git a/test/relaxng/tutor12_1.rng b/test/relaxng/tutor12_1.rng new file mode 100644 index 00000000..39026874 --- /dev/null +++ b/test/relaxng/tutor12_1.rng @@ -0,0 +1,13 @@ + + + + Information about a single email address. + + + + + + + + + diff --git a/test/relaxng/tutor12_1_1.xml b/test/relaxng/tutor12_1_1.xml new file mode 100644 index 00000000..693df185 --- /dev/null +++ b/test/relaxng/tutor12_1_1.xml @@ -0,0 +1,3 @@ + + foobar + diff --git a/test/relaxng/tutor13_1.rng b/test/relaxng/tutor13_1.rng new file mode 100644 index 00000000..f945142c --- /dev/null +++ b/test/relaxng/tutor13_1.rng @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/relaxng/tutor13_1_1.xml b/test/relaxng/tutor13_1_1.xml new file mode 100644 index 00000000..a5cb437d --- /dev/null +++ b/test/relaxng/tutor13_1_1.xml @@ -0,0 +1,12 @@ + +

start

+ + + + + + + +
hello !
+

end

+