You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by tn...@apache.org on 2002/09/24 22:10:30 UTC
cvs commit: xml-xerces/c/src/xercesc/validators/DTD DTDScanner.cpp DTDValidator.cpp
tng 2002/09/24 13:10:30
Modified: c/src/xercesc/validators/DTD DTDScanner.cpp DTDValidator.cpp
Log:
Performance: use XMLString::equals instead of XMLString::compareString
Revision Changes Path
1.13 +11 -8 xml-xerces/c/src/xercesc/validators/DTD/DTDScanner.cpp
Index: DTDScanner.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/validators/DTD/DTDScanner.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- DTDScanner.cpp 22 Aug 2002 21:05:29 -0000 1.12
+++ DTDScanner.cpp 24 Sep 2002 20:10:30 -0000 1.13
@@ -56,6 +56,9 @@
/*
* $Log$
+ * Revision 1.13 2002/09/24 20:10:30 tng
+ * Performance: use XMLString::equals instead of XMLString::compareString
+ *
* Revision 1.12 2002/08/22 21:05:29 tng
* [Bug 7475] Xerces-C++ reports validation error with Docbook.
*
@@ -657,7 +660,7 @@
// if attdef is xml:space, check correct enumeration (default|preserve)
const XMLCh fgXMLSpace[] = { chLatin_x, chLatin_m, chLatin_l, chColon, chLatin_s, chLatin_p, chLatin_a, chLatin_c, chLatin_e, chNull };
- if (!XMLString::compareString(decl->getFullName(),fgXMLSpace)) {
+ if (XMLString::equals(decl->getFullName(),fgXMLSpace)) {
const XMLCh fgPreserve[] = { chLatin_p, chLatin_r, chLatin_e, chLatin_s, chLatin_e, chLatin_r, chLatin_v, chLatin_e, chNull };
const XMLCh fgDefault[] = { chLatin_d, chLatin_e, chLatin_f, chLatin_a, chLatin_u, chLatin_l, chLatin_t, chNull };
bool ok = false;
@@ -665,14 +668,14 @@
RefVectorOf<XMLCh>* enumVector = XMLString::tokenizeString(decl->getEnumeration());
int size = enumVector->size();
ok = (size == 1 &&
- (!XMLString::compareString(enumVector->elementAt(0), fgDefault) ||
- !XMLString::compareString(enumVector->elementAt(0), fgPreserve))) ||
+ (XMLString::equals(enumVector->elementAt(0), fgDefault) ||
+ XMLString::equals(enumVector->elementAt(0), fgPreserve))) ||
(size == 2 &&
- (!XMLString::compareString(enumVector->elementAt(0), fgDefault) &&
- !XMLString::compareString(enumVector->elementAt(1), fgPreserve))) ||
+ (XMLString::equals(enumVector->elementAt(0), fgDefault) &&
+ XMLString::equals(enumVector->elementAt(1), fgPreserve))) ||
(size == 2 &&
- (!XMLString::compareString(enumVector->elementAt(1), fgDefault) &&
- !XMLString::compareString(enumVector->elementAt(0), fgPreserve)));
+ (XMLString::equals(enumVector->elementAt(1), fgDefault) &&
+ XMLString::equals(enumVector->elementAt(0), fgPreserve)));
delete enumVector;
}
if (!ok)
@@ -3661,7 +3664,7 @@
}
// If its not our supported version, issue an error but continue
- if (XMLString::compareString(bbVersion.getRawBuffer(), XMLUni::fgSupportedVersion))
+ if (!XMLString::equals(bbVersion.getRawBuffer(), XMLUni::fgSupportedVersion))
fScanner->emitError(XMLErrs::UnsupportedXMLVersion, bbVersion.getRawBuffer());
}
1.5 +2 -2 xml-xerces/c/src/xercesc/validators/DTD/DTDValidator.cpp
Index: DTDValidator.cpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/validators/DTD/DTDValidator.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- DTDValidator.cpp 16 Sep 2002 20:37:21 -0000 1.4
+++ DTDValidator.cpp 24 Sep 2002 20:10:30 -0000 1.5
@@ -222,7 +222,7 @@
//
if (defType == XMLAttDef::Fixed && !preValidation)
{
- if (XMLString::compareString(attrValue, valueText))
+ if (!XMLString::equals(attrValue, valueText))
emitError(XMLValid::NotSameAsFixedValue, fullName, attrValue, valueText);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org