summaryrefslogtreecommitdiff
path: root/relaxng.c
diff options
context:
space:
mode:
authorMike Hommey <mh@glandium.org>2004-04-19 05:38:48 +0000
committerMike Hommey <mh@glandium.org>2004-04-19 05:38:48 +0000
commit81bcf076ea11e114a60e429338a15748066de163 (patch)
tree276010ab5d17f27a96c05f77004aa84a1763af7b /relaxng.c
parentd09ab089457ae3c20cc98f9afa03379c6ebf9598 (diff)
downloadlibxml2-81bcf076ea11e114a60e429338a15748066de163.tar.gz
Load /tmp/tmp.LovooJ/libxml2-2.6.9 intoupstream/2.6.9
packages/libxml2/branches/upstream/current.
Diffstat (limited to 'relaxng.c')
-rw-r--r--relaxng.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/relaxng.c b/relaxng.c
index 1fd46e9..6bf62ee 100644
--- a/relaxng.c
+++ b/relaxng.c
@@ -2340,7 +2340,8 @@ xmlRelaxNGAddValidError(xmlRelaxNGValidCtxtPtr ctxt,
/*
* generate the error directly
*/
- if (((ctxt->flags & 1) == 0) || (ctxt->flags & 2)) {
+ if (((ctxt->flags & FLAGS_IGNORABLE) == 0) ||
+ (ctxt->flags & FLAGS_NEGATIVE)) {
xmlNodePtr node, seq;
/*
@@ -2880,9 +2881,15 @@ xmlRelaxNGIsCompileable(xmlRelaxNGDefinePtr def)
break;
list = list->next;
}
- if (ret == 0)
+ /*
+ * Because the routine is recursive, we must guard against
+ * discovering both COMPILABLE and NOT_COMPILABLE
+ */
+ if (ret == 0) {
+ def->dflags &= ~IS_COMPILABLE;
def->dflags |= IS_NOT_COMPILABLE;
- if (ret == 1)
+ }
+ if ((ret == 1) && !(def->dflags &= IS_NOT_COMPILABLE))
def->dflags |= IS_COMPILABLE;
#ifdef DEBUG_COMPILE
if (ret == 1) {
@@ -2952,10 +2959,8 @@ xmlRelaxNGIsCompileable(xmlRelaxNGDefinePtr def)
case XML_RELAXNG_LIST:
case XML_RELAXNG_PARAM:
case XML_RELAXNG_VALUE:
- ret = 0;
- break;
case XML_RELAXNG_NOT_ALLOWED:
- ret = -1;
+ ret = 0;
break;
}
if (ret == 0)
@@ -3746,15 +3751,15 @@ xmlRelaxNGCompareNameClasses(xmlRelaxNGDefinePtr def1,
} else {
node.name = invalidName;
}
- node.ns = &ns;
if (def1->ns != NULL) {
if (def1->ns[0] == 0) {
node.ns = NULL;
} else {
+ node.ns = &ns;
ns.href = def1->ns;
}
} else {
- ns.href = invalidName;
+ node.ns = NULL;
}
if (xmlRelaxNGElementMatch(&ctxt, def2, &node)) {
if (def1->nameClass != NULL) {