knoaman 2003/11/07 09:08:12 Modified: c/src/xercesc/validators/common CMBinaryOp.cpp ContentSpecNode.cpp ContentSpecNode.hpp DFAContentModel.cpp MixedContentModel.cpp SimpleContentModel.cpp c/src/xercesc/validators/schema ComplexTypeInfo.cpp SchemaValidator.cpp TraverseSchema.cpp Log: For PSVI support, distinguish wildcard elements with namespace lists. Revision Changes Path 1.4 +7 -4 xml-xerces/c/src/xercesc/validators/common/CMBinaryOp.cpp Index: CMBinaryOp.cpp =================================================================== RCS file: /home/cvs/xml-xerces/c/src/xercesc/validators/common/CMBinaryOp.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- CMBinaryOp.cpp 15 May 2003 18:48:27 -0000 1.3 +++ CMBinaryOp.cpp 7 Nov 2003 17:08:11 -0000 1.4 @@ -56,6 +56,9 @@ /* * $Log$ + * Revision 1.4 2003/11/07 17:08:11 knoaman + * For PSVI support, distinguish wildcard elements with namespace lists. + * * Revision 1.3 2003/05/15 18:48:27 knoaman * Partial implementation of the configurable memory manager. * @@ -116,7 +119,7 @@ , fRightChild(rightToAdopt) { // Insure that its one of the types we require - if ((type != ContentSpecNode::Choice) + if (((type & 0x0f) != ContentSpecNode::Choice) && (type != ContentSpecNode::Sequence)) { ThrowXML(RuntimeException, XMLExcepts::CM_BinOpHadUnaryType); @@ -164,7 +167,7 @@ // this node is nullable. If its a concatenation, then both of // them have to be nullable. // - if (getType() == ContentSpecNode::Choice) + if ((getType() & 0x0f) == ContentSpecNode::Choice) return (fLeftChild->isNullable() || fRightChild->isNullable()); return (fLeftChild->isNullable() && fRightChild->isNullable()); @@ -176,7 +179,7 @@ // --------------------------------------------------------------------------- void CMBinaryOp::calcFirstPos(CMStateSet& toSet) const { - if (getType() == ContentSpecNode::Choice) + if ((getType() & 0x0f) == ContentSpecNode::Choice) { // Its the the union of the first positions of our children. toSet = fLeftChild->getFirstPos(); @@ -197,7 +200,7 @@ void CMBinaryOp::calcLastPos(CMStateSet& toSet) const { - if (getType() == ContentSpecNode::Choice) + if ((getType() & 0x0f) == ContentSpecNode::Choice) { // Its the the union of the first positions of our children. toSet = fLeftChild->getLastPos(); 1.10 +6 -5 xml-xerces/c/src/xercesc/validators/common/ContentSpecNode.cpp Index: ContentSpecNode.cpp =================================================================== RCS file: /home/cvs/xml-xerces/c/src/xercesc/validators/common/ContentSpecNode.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- ContentSpecNode.cpp 26 Sep 2003 18:29:27 -0000 1.9 +++ ContentSpecNode.cpp 7 Nov 2003 17:08:11 -0000 1.10 @@ -171,6 +171,7 @@ break; case ContentSpecNode::Choice : + case ContentSpecNode::Any_NS_Choice: if (parentType != curType) bufToFill.append(chOpenParen); formatNode(first, curType, bufToFill); @@ -234,7 +235,7 @@ if (fType == ContentSpecNode::Sequence || fType == ContentSpecNode::All - || fType == ContentSpecNode::Choice) { + || (fType & 0x0f) == ContentSpecNode::Choice) { int minFirst = fFirst->getMinTotalRange(); @@ -242,7 +243,7 @@ int minSecond = fSecond->getMinTotalRange(); - if (fType == ContentSpecNode::Choice) { + if ((fType & 0x0f) == ContentSpecNode::Choice) { min = min * ((minFirst < minSecond)? minFirst : minSecond); } else { @@ -266,7 +267,7 @@ if (fType == ContentSpecNode::Sequence || fType == ContentSpecNode::All - || fType == ContentSpecNode::Choice) { + || (fType & 0x0f) == ContentSpecNode::Choice) { int maxFirst = fFirst->getMaxTotalRange(); @@ -283,7 +284,7 @@ } else { - if (fType == ContentSpecNode::Choice) { + if ((fType & 0x0f) == ContentSpecNode::Choice) { max = max * (maxFirst > maxSecond) ? maxFirst : maxSecond; } else { 1.9 +4 -0 xml-xerces/c/src/xercesc/validators/common/ContentSpecNode.hpp Index: ContentSpecNode.hpp =================================================================== RCS file: /home/cvs/xml-xerces/c/src/xercesc/validators/common/ContentSpecNode.hpp,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- ContentSpecNode.hpp 26 Sep 2003 18:29:27 -0000 1.8 +++ ContentSpecNode.hpp 7 Nov 2003 17:08:11 -0000 1.9 @@ -56,6 +56,9 @@ /* * $Log$ + * Revision 1.9 2003/11/07 17:08:11 knoaman + * For PSVI support, distinguish wildcard elements with namespace lists. + * * Revision 1.8 2003/09/26 18:29:27 peiyongz * Implement serialization/deserialization * @@ -196,6 +199,7 @@ , Any_Other , Any_NS = 8 , All = 9 + , Any_NS_Choice = 20 , Any_Lax = 22 , Any_Other_Lax = 23 , Any_NS_Lax = 24 1.8 +6 -3 xml-xerces/c/src/xercesc/validators/common/DFAContentModel.cpp Index: DFAContentModel.cpp =================================================================== RCS file: /home/cvs/xml-xerces/c/src/xercesc/validators/common/DFAContentModel.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- DFAContentModel.cpp 18 May 2003 14:02:06 -0000 1.7 +++ DFAContentModel.cpp 7 Nov 2003 17:08:11 -0000 1.8 @@ -56,6 +56,9 @@ /* * $Log$ + * Revision 1.8 2003/11/07 17:08:11 knoaman + * For PSVI support, distinguish wildcard elements with namespace lists. + * * Revision 1.7 2003/05/18 14:02:06 knoaman * Memory manager implementation: pass per instance manager. * @@ -1090,7 +1093,7 @@ ContentSpecNode* leftNode = curNode->getFirst(); ContentSpecNode* rightNode = curNode->getSecond(); - if ((curType == ContentSpecNode::Choice) + if (((curType & 0x0f) == ContentSpecNode::Choice) || (curType == ContentSpecNode::Sequence)) { // @@ -1134,7 +1137,7 @@ // Get the spec type of the passed node const ContentSpecNode::NodeTypes curType = curNode->getType(); - if (curType == ContentSpecNode::Choice) + if ((curType & 0x0f) == ContentSpecNode::Choice) { // Just recurse calcFollowList(((CMBinaryOp*)curNode)->getLeft()); @@ -1246,7 +1249,7 @@ fLeafListType[newIndex] = curType; ++newIndex; } - else if ((curType == ContentSpecNode::Choice) + else if (((curType & 0x0f) == ContentSpecNode::Choice) || (curType == ContentSpecNode::Sequence)) { newIndex = postTreeBuildInit(((CMBinaryOp*)nodeCur)->getLeft(), newIndex); 1.7 +4 -1 xml-xerces/c/src/xercesc/validators/common/MixedContentModel.cpp Index: MixedContentModel.cpp =================================================================== RCS file: /home/cvs/xml-xerces/c/src/xercesc/validators/common/MixedContentModel.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- MixedContentModel.cpp 18 May 2003 14:02:06 -0000 1.6 +++ MixedContentModel.cpp 7 Nov 2003 17:08:11 -0000 1.7 @@ -56,6 +56,9 @@ /* * $Log$ + * Revision 1.7 2003/11/07 17:08:11 knoaman + * For PSVI support, distinguish wildcard elements with namespace lists. + * * Revision 1.6 2003/05/18 14:02:06 knoaman * Memory manager implementation: pass per instance manager. * @@ -481,7 +484,7 @@ ContentSpecNode* rightNode = curNode->getSecond(); // And recurse according to the type of node - if ((curType == ContentSpecNode::Choice) + if (((curType & 0x0f) == ContentSpecNode::Choice) || (curType == ContentSpecNode::Sequence)) { // Recurse on the left and right nodes 1.5 +6 -1 xml-xerces/c/src/xercesc/validators/common/SimpleContentModel.cpp Index: SimpleContentModel.cpp =================================================================== RCS file: /home/cvs/xml-xerces/c/src/xercesc/validators/common/SimpleContentModel.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- SimpleContentModel.cpp 4 Nov 2002 14:54:58 -0000 1.4 +++ SimpleContentModel.cpp 7 Nov 2003 17:08:11 -0000 1.5 @@ -56,6 +56,9 @@ /* * $Log$ + * Revision 1.5 2003/11/07 17:08:11 knoaman + * For PSVI support, distinguish wildcard elements with namespace lists. + * * Revision 1.4 2002/11/04 14:54:58 tng * C++ Namespace Support. * @@ -258,6 +261,7 @@ break; case ContentSpecNode::Choice : + case ContentSpecNode::Any_NS_Choice : // // There can only be one child, and it must be one of the // two types we stored. @@ -425,6 +429,7 @@ break; case ContentSpecNode::Choice : + case ContentSpecNode::Any_NS_Choice : // // There can only be one child, and it must be one of the // two types we stored. @@ -521,7 +526,7 @@ fSecondChild->setURI(pContentSpecOrgURI[orgURIIndex]); // only possible violation is when it's a choice - if (fOp == ContentSpecNode::Choice) { + if ((fOp & 0x0f) == ContentSpecNode::Choice) { SubstitutionGroupComparator comparator(pGrammarResolver, pStringPool); 1.17 +5 -2 xml-xerces/c/src/xercesc/validators/schema/ComplexTypeInfo.cpp Index: ComplexTypeInfo.cpp =================================================================== RCS file: /home/cvs/xml-xerces/c/src/xercesc/validators/schema/ComplexTypeInfo.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -u -r1.16 -r1.17 --- ComplexTypeInfo.cpp 29 Oct 2003 16:22:58 -0000 1.16 +++ ComplexTypeInfo.cpp 7 Nov 2003 17:08:12 -0000 1.17 @@ -56,6 +56,9 @@ /* * $Log$ + * Revision 1.17 2003/11/07 17:08:12 knoaman + * For PSVI support, distinguish wildcard elements with namespace lists. + * * Revision 1.16 2003/10/29 16:22:58 peiyongz * allow proper recreation of ContentModel from deserialization * @@ -590,7 +593,7 @@ , fMemoryManager ); } - else if ((specType == ContentSpecNode::Choice) + else if (((specType & 0x0f) == ContentSpecNode::Choice) || (specType == ContentSpecNode::Sequence)) { // @@ -679,7 +682,7 @@ { retNode = expandContentModel(curNode, minOccurs, maxOccurs); } - else if ((curType == ContentSpecNode::Choice) + else if (((curType & 0x0f) == ContentSpecNode::Choice) || (curType == ContentSpecNode::All) || (curType == ContentSpecNode::Sequence)) { 1.40 +12 -3 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.39 retrieving revision 1.40 diff -u -r1.39 -r1.40 --- SchemaValidator.cpp 5 Oct 2003 02:09:37 -0000 1.39 +++ SchemaValidator.cpp 7 Nov 2003 17:08:12 -0000 1.40 @@ -56,6 +56,9 @@ /* * $Log$ + * Revision 1.40 2003/11/07 17:08:12 knoaman + * For PSVI support, distinguish wildcard elements with namespace lists. + * * Revision 1.39 2003/10/05 02:09:37 neilg * the validator now keeps track of the current complex and simple type (including if this is an xsi:type). This allows both the validator and the scanner to know what the current type is, without the need to modify the element declaration each time an xsi:type is seen * @@ -1404,13 +1407,13 @@ ContentSpecNode::NodeTypes baseNodeType = baseSpecNode->getType(); if (curNodeType == ContentSpecNode::Sequence || - curNodeType == ContentSpecNode::Choice || + (curNodeType & 0x0f) == ContentSpecNode::Choice || curNodeType == ContentSpecNode::All) { curSpecNode = checkForPointlessOccurrences(curSpecNode, curNodeType, &curVector); } if (baseNodeType == ContentSpecNode::Sequence || - baseNodeType == ContentSpecNode::Choice || + (baseNodeType & 0x0f) == ContentSpecNode::Choice || baseNodeType == ContentSpecNode::All) { baseSpecNode = checkForPointlessOccurrences(baseSpecNode, baseNodeType, &baseVector); } @@ -1435,6 +1438,7 @@ return; } case ContentSpecNode::Choice: + case ContentSpecNode::Any_NS_Choice: case ContentSpecNode::Sequence: case ContentSpecNode::All: { @@ -1461,6 +1465,7 @@ return; } case ContentSpecNode::Choice: + case ContentSpecNode::Any_NS_Choice: case ContentSpecNode::Sequence: case ContentSpecNode::All: case ContentSpecNode::Leaf: @@ -1490,6 +1495,7 @@ return; } case ContentSpecNode::Choice: + case ContentSpecNode::Any_NS_Choice: case ContentSpecNode::Sequence: case ContentSpecNode::Leaf: { @@ -1502,6 +1508,7 @@ } } case ContentSpecNode::Choice: + case ContentSpecNode::Any_NS_Choice: { switch (baseNodeType & 0x0f) { case ContentSpecNode::Any: @@ -1512,6 +1519,7 @@ return; } case ContentSpecNode::Choice: + case ContentSpecNode::Any_NS_Choice: { checkRecurse(aGrammar, curSpecNode, derivedScope, &curVector, baseSpecNode, baseScope, &baseVector, baseInfo, true); @@ -1552,6 +1560,7 @@ return; } case ContentSpecNode::Choice: + case ContentSpecNode::Any_NS_Choice: { checkMapAndSum(aGrammar, curSpecNode, &curVector, derivedScope, baseSpecNode, &baseVector, baseScope, baseInfo); @@ -1896,7 +1905,7 @@ derivedNodes.addElement(derivedSpecNode); - if (baseSpecNode->getType() == ContentSpecNode::Choice) { + if ((baseSpecNode->getType() & 0x0f) == ContentSpecNode::Choice) { toLax = true; } 1.92 +2 -2 xml-xerces/c/src/xercesc/validators/schema/TraverseSchema.cpp Index: TraverseSchema.cpp =================================================================== RCS file: /home/cvs/xml-xerces/c/src/xercesc/validators/schema/TraverseSchema.cpp,v retrieving revision 1.91 retrieving revision 1.92 diff -u -r1.91 -r1.92 --- TraverseSchema.cpp 6 Nov 2003 19:28:11 -0000 1.91 +++ TraverseSchema.cpp 7 Nov 2003 17:08:12 -0000 1.92 @@ -1853,7 +1853,7 @@ else { secondNode = new (fGrammarPoolMemoryManager) ContentSpecNode ( - ContentSpecNode::Choice + ContentSpecNode::Any_NS_Choice , secondNode , firstNode , true
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]