aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Veillard <veillard@redhat.com>2009-08-12 15:39:23 +0200
committerDaniel Veillard <veillard@redhat.com>2009-08-12 15:39:23 +0200
commitbd56c44349d9e14ed54e77b2706d0f92d1a1f994 (patch)
treeeecf097d9627932e1a4f8aa5fd4b1628d89f2f43
parentbe390ed0a1cff06a6157ea189984d9d9e8cedcb1 (diff)
downloadandroid_external_libxml2-bd56c44349d9e14ed54e77b2706d0f92d1a1f994.tar.gz
android_external_libxml2-bd56c44349d9e14ed54e77b2706d0f92d1a1f994.tar.bz2
android_external_libxml2-bd56c44349d9e14ed54e77b2706d0f92d1a1f994.zip
571271 fix semantic of xsd:all with minOccurs=0
* xmlschemas.c: apparently we though it allowed any of the sub elements to be missing, and probably not what's expected from the spec, though it used to forbid it c.f.: http://lists.xml.org/archives/xml-dev/200109/msg00512.html asking HT for confirmation but it's likely that we were wrong on the semantic * result/schemas/all_1_[367]*: this changes the output of soem of our internal regression tests
-rw-r--r--result/schemas/all_1_32
-rw-r--r--result/schemas/all_1_3.err1
-rw-r--r--result/schemas/all_1_62
-rw-r--r--result/schemas/all_1_6.err1
-rw-r--r--result/schemas/all_1_72
-rw-r--r--result/schemas/all_1_7.err1
-rw-r--r--xmlschemas.c14
7 files changed, 15 insertions, 8 deletions
diff --git a/result/schemas/all_1_3 b/result/schemas/all_1_3
index 8186e826..55a2a4da 100644
--- a/result/schemas/all_1_3
+++ b/result/schemas/all_1_3
@@ -1 +1 @@
-./test/schemas/all_3.xml validates
+./test/schemas/all_3.xml fails to validate
diff --git a/result/schemas/all_1_3.err b/result/schemas/all_1_3.err
index e69de29b..6933fb7b 100644
--- a/result/schemas/all_1_3.err
+++ b/result/schemas/all_1_3.err
@@ -0,0 +1 @@
+./test/schemas/all_3.xml:1: element doc: Schemas validity error : Element 'doc': Missing child element(s). Expected is ( c ).
diff --git a/result/schemas/all_1_6 b/result/schemas/all_1_6
index d4a95948..c3705c75 100644
--- a/result/schemas/all_1_6
+++ b/result/schemas/all_1_6
@@ -1 +1 @@
-./test/schemas/all_6.xml validates
+./test/schemas/all_6.xml fails to validate
diff --git a/result/schemas/all_1_6.err b/result/schemas/all_1_6.err
index e69de29b..c31d91b8 100644
--- a/result/schemas/all_1_6.err
+++ b/result/schemas/all_1_6.err
@@ -0,0 +1 @@
+./test/schemas/all_6.xml:1: element doc: Schemas validity error : Element 'doc': Missing child element(s). Expected is one of ( b, c ).
diff --git a/result/schemas/all_1_7 b/result/schemas/all_1_7
index 6ad4fc60..d144d2de 100644
--- a/result/schemas/all_1_7
+++ b/result/schemas/all_1_7
@@ -1 +1 @@
-./test/schemas/all_7.xml validates
+./test/schemas/all_7.xml fails to validate
diff --git a/result/schemas/all_1_7.err b/result/schemas/all_1_7.err
index e69de29b..d5c54287 100644
--- a/result/schemas/all_1_7.err
+++ b/result/schemas/all_1_7.err
@@ -0,0 +1 @@
+./test/schemas/all_7.xml:1: element doc: Schemas validity error : Element 'doc': Missing child element(s). Expected is ( c ).
diff --git a/xmlschemas.c b/xmlschemas.c
index d3fe98a4..96d55b82 100644
--- a/xmlschemas.c
+++ b/xmlschemas.c
@@ -12966,17 +12966,19 @@ xmlSchemaBuildAContentModel(xmlSchemaParserCtxtPtr pctxt,
break;
}
case XML_SCHEMA_TYPE_ALL:{
- xmlAutomataStatePtr start;
+ xmlAutomataStatePtr start, tmp;
xmlSchemaParticlePtr sub;
xmlSchemaElementPtr elemDecl;
- int lax;
sub = (xmlSchemaParticlePtr) particle->children->children;
if (sub == NULL)
break;
start = pctxt->state;
+ tmp = xmlAutomataNewState(pctxt->am);
+ xmlAutomataNewEpsilon(pctxt->am, pctxt->state, tmp);
+ pctxt->state = tmp;
while (sub != NULL) {
- pctxt->state = start;
+ pctxt->state = tmp;
elemDecl = (xmlSchemaElementPtr) sub->children;
if (elemDecl == NULL) {
@@ -13024,9 +13026,11 @@ xmlSchemaBuildAContentModel(xmlSchemaParserCtxtPtr pctxt,
}
sub = (xmlSchemaParticlePtr) sub->next;
}
- lax = particle->minOccurs == 0;
pctxt->state =
- xmlAutomataNewAllTrans(pctxt->am, pctxt->state, NULL, lax);
+ xmlAutomataNewAllTrans(pctxt->am, pctxt->state, NULL, 0);
+ if (particle->minOccurs == 0) {
+ xmlAutomataNewEpsilon(pctxt->am, start, pctxt->state);
+ }
break;
}
case XML_SCHEMA_TYPE_GROUP: