[prev in list] [next in list] [prev in thread] [next in thread]
List: xerces-cvs
Subject: svn commit: r799211 -
From: amassari () apache ! org
Date: 2009-07-30 9:06:43
Message-ID: 20090730090644.075B1238898B () eris ! apache ! org
[Download RAW message or body]
Author: amassari
Date: Thu Jul 30 09:06:43 2009
New Revision: 799211
URL: http://svn.apache.org/viewvc?rev=799211&view=rev
Log:
Before complaining that there are not enough child nodes, test the existing ones to \
be correct (XERCESC-1246)
Modified:
xerces/c/trunk/src/xercesc/validators/common/SimpleContentModel.cpp
Modified: xerces/c/trunk/src/xercesc/validators/common/SimpleContentModel.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/validators/common/SimpleContentModel.cpp?rev=799211&r1=799210&r2=799211&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/validators/common/SimpleContentModel.cpp (original)
+++ xerces/c/trunk/src/xercesc/validators/common/SimpleContentModel.cpp Thu Jul 30 \
09:06:43 2009 @@ -222,39 +222,47 @@
return false;
}
- if (childCount == 2) {
+ // test first child
+ if (fDTD) {
+ if (!XMLString::equals(children[0]->getRawName(), \
fFirstChild->getRawName())) { + *indexFailingChild=0;
+ return false;
+ }
+ }
+ else {
+ if ((children[0]->getURI() != fFirstChild->getURI()) ||
+ !XMLString::equals(children[0]->getLocalPart(), \
fFirstChild->getLocalPart())) { + *indexFailingChild=0;
+ return false;
+ }
+ }
+ // test second child, if present
+ if( childCount == 1)
+ {
+ // missing second child
+ *indexFailingChild=1;
+ return false;
+ }
+ else
+ {
if (fDTD) {
- if (!XMLString::equals(children[0]->getRawName(), \
fFirstChild->getRawName())) {
- *indexFailingChild=0;
- return false;
- }
if (!XMLString::equals(children[1]->getRawName(), \
fSecondChild->getRawName())) {
*indexFailingChild=1;
return false;
}
}
else {
- if ((children[0]->getURI() != fFirstChild->getURI()) ||
- !XMLString::equals(children[0]->getLocalPart(), \
fFirstChild->getLocalPart())) {
- *indexFailingChild=0;
- return false;
- }
-
if ((children[1]->getURI() != fSecondChild->getURI()) ||
!XMLString::equals(children[1]->getLocalPart(), \
fSecondChild->getLocalPart())) {
*indexFailingChild=1;
return false;
}
}
- }
- else {
+
if (childCount > 2) {
*indexFailingChild=2;
return false;
}
-
- *indexFailingChild=childCount;
- return false;
}
break;
@@ -429,18 +437,25 @@
return false;
}
- if (childCount == 2)
+ // test first child
+ if ((children[0]->getURI() != fFirstChild->getURI()) ||
+ !XMLString::equals(children[0]->getLocalPart(), \
fFirstChild->getLocalPart())) {
- if ((children[0]->getURI() != fFirstChild->getURI()) ||
- !XMLString::equals(children[0]->getLocalPart(), \
fFirstChild->getLocalPart())) + \
if(!comparator.isEquivalentTo(children[0], fFirstChild)) {
- if(!comparator.isEquivalentTo(children[0], fFirstChild))
- {
- *indexFailingChild=0;
- return false;
- }
+ *indexFailingChild=0;
+ return false;
}
-
+ }
+ // test second child, if present
+ if( childCount == 1)
+ {
+ // missing second child
+ *indexFailingChild=1;
+ return false;
+ }
+ else
+ {
if ((children[1]->getURI() != fSecondChild->getURI()) ||
!XMLString::equals(children[1]->getLocalPart(), \
fSecondChild->getLocalPart())) {
@@ -450,17 +465,12 @@
return false;
}
}
- }
- else
- {
- if (childCount > 2)
- {
+
+ if (childCount > 2) {
*indexFailingChild=2;
return false;
}
- *indexFailingChild=childCount;
- return false;
}
break;
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xerces.apache.org
For additional commands, e-mail: commits-help@xerces.apache.org
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic