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/04 20:17:49 UTC
cvs commit: xml-xerces/c/src/xercesc/validators/DTD DTDValidator.cpp DTDValidator.hpp
tng 2002/09/04 11:17:49
Modified: c/src/xercesc/validators/DTD DTDValidator.cpp
DTDValidator.hpp
Log:
Do not set IDREF to used during prevalidation.
Revision Changes Path
1.3 +13 -5 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.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- DTDValidator.cpp 11 Jul 2002 18:55:44 -0000 1.2
+++ DTDValidator.cpp 4 Sep 2002 18:17:49 -0000 1.3
@@ -199,7 +199,8 @@
void
DTDValidator::validateAttrValue(const XMLAttDef* attDef
- , const XMLCh* const attrValue)
+ , const XMLCh* const attrValue
+ , bool preValidation)
{
//
// Get quick refs to lost of of the stuff in the passed objects in
@@ -215,8 +216,11 @@
//
// If the default type is fixed, then make sure the passed value maps
// to the fixed value.
+ // If during preContentValidation, the value we are validating is the fixed value itself
+ // so no need to compare.
+ // Only need to do this for regular attribute value validation
//
- if (defType == XMLAttDef::Fixed)
+ if (defType == XMLAttDef::Fixed && !preValidation)
{
if (XMLString::compareString(attrValue, valueText))
emitError(XMLValid::NotSameAsFixedValue, fullName, attrValue, valueText);
@@ -373,8 +377,11 @@
//
if (type == XMLAttDef::ID)
find->setDeclared(true);
- else
- find->setUsed(true);
+ else {
+ if (!preValidation) {
+ find->setUsed(true);
+ }
+ }
}
}
else if ((type == XMLAttDef::Entity) || (type == XMLAttDef::Entities))
@@ -576,6 +583,7 @@
(
&curAttDef
, curAttDef.getValue()
+ , true
);
}
}
1.4 +4 -0 xml-xerces/c/src/xercesc/validators/DTD/DTDValidator.hpp
Index: DTDValidator.hpp
===================================================================
RCS file: /home/cvs/xml-xerces/c/src/xercesc/validators/DTD/DTDValidator.hpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- DTDValidator.hpp 22 Aug 2002 15:05:40 -0000 1.3
+++ DTDValidator.hpp 4 Sep 2002 18:17:49 -0000 1.4
@@ -56,6 +56,9 @@
/*
* $Log$
+ * Revision 1.4 2002/09/04 18:17:49 tng
+ * Do not set IDREF to used during prevalidation.
+ *
* Revision 1.3 2002/08/22 15:05:40 tng
* Remove unused parameter variables in inline functions.
*
@@ -173,6 +176,7 @@
(
const XMLAttDef* attDef
, const XMLCh* const attrValue
+ , bool preValidation = false
);
virtual void validateElement
(
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org