knoaman 2004/03/01 13:06:38
Modified: c/src/xercesc/validators/schema SchemaValidator.hpp
SchemaValidator.cpp
Log:
Fix for UPA checking
Revision Changes Path
1.26 +4 -0 xml-xerces/c/src/xercesc/validators/schema/SchemaValidator.hpp
Index: SchemaValidator.hpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/validators/schema/SchemaValidator.hpp,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- SchemaValidator.hpp 29 Jan 2004 11:52:31 -0000 1.25
+++ SchemaValidator.hpp 1 Mar 2004 21:06:38 -0000 1.26
@@ -56,6 +56,9 @@
/*
* $Log$
+ * Revision 1.26 2004/03/01 21:06:38 knoaman
+ * Fix for UPA checking
+ *
* Revision 1.25 2004/01/29 11:52:31 cargilld
* Code cleanup changes to get rid of various compiler diagnostic messages.
*
@@ -382,6 +385,7 @@
ValueVectorOf<ContentSpecNode*>* const baseNodes,
const int baseScope,
const ComplexTypeInfo* const baseInfo);
+ ContentSpecNode* getNonUnaryGroup(ContentSpecNode* const pNode);
// -----------------------------------------------------------------------
// Private data members
1.53 +21 -2 xml-xerces/c/src/xercesc/validators/schema/SchemaValidator.cpp
Index: SchemaValidator.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/validators/schema/SchemaValidator.cpp,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -r1.52 -r1.53
--- SchemaValidator.cpp 29 Jan 2004 11:52:31 -0000 1.52
+++ SchemaValidator.cpp 1 Mar 2004 21:06:38 -0000 1.53
@@ -56,6 +56,9 @@
/*
* $Log$
+ * Revision 1.53 2004/03/01 21:06:38 knoaman
+ * Fix for UPA checking
+ *
* Revision 1.52 2004/01/29 11:52:31 cargilld
* Code cleanup changes to get rid of various compiler diagnostic messages.
*
@@ -1377,6 +1380,22 @@
}
}
+ContentSpecNode* SchemaValidator::getNonUnaryGroup(ContentSpecNode* const pNode) {
+
+ int pNodeType = (pNode->getType() & 0x0f);
+ if (pNodeType == ContentSpecNode::Leaf
+ || pNodeType == ContentSpecNode::Any
+ || pNodeType == ContentSpecNode::Any_Other
+ || pNodeType == ContentSpecNode::Any_NS)
+ return pNode;
+
+ if (pNode->getMinOccurs() == 1 && pNode->getMaxOccurs() == 1
+ && pNode->getFirst() && !pNode->getSecond())
+ return getNonUnaryGroup(pNode->getFirst());
+
+ return pNode;
+}
+
void SchemaValidator::checkParticleDerivationOk(SchemaGrammar* const aGrammar,
ContentSpecNode* const curNode,
const int derivedScope,
@@ -1394,8 +1413,8 @@
if (!curNode)
return;
- ContentSpecNode* curSpecNode = curNode;
- ContentSpecNode* baseSpecNode = baseNode;
+ ContentSpecNode* curSpecNode = getNonUnaryGroup(curNode);
+ ContentSpecNode* baseSpecNode = getNonUnaryGroup(baseNode);
ValueVectorOf<ContentSpecNode*> curVector(8, fMemoryManager);
ValueVectorOf<ContentSpecNode*> baseVector(8, fMemoryManager);
ContentSpecNode::NodeTypes curNodeType = curSpecNode->getType();
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]