tng 2002/11/28 09:36:32
Modified: c/src/xercesc/validators/DTD DTDValidator.cpp
Log:
Namespace Validity: if namespace is on and validation is on, attribute values
declared to be of types ID, IDREF(S), ENTITY(IES), and NOTATION are also Names, and
thus should be colon-free.
Revision Changes Path
1.8 +11 -1 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.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- DTDValidator.cpp 7 Nov 2002 21:58:56 -0000 1.7
+++ DTDValidator.cpp 28 Nov 2002 17:36:32 -0000 1.8
@@ -236,6 +236,8 @@
if (type == XMLAttDef::CData)
return;
+
+
// An empty string cannot be valid for any of the other types
if (!attrValue[0])
{
@@ -335,6 +337,14 @@
}
break;
}
+
+ // Now this attribute can be of type
+ // ID, IDREF, IDREFS, ENTITY, ENTITIES, NOTATION, NMTOKEN,
NMTOKENS, ENUMERATION
+ // All these must be valid XMLName
+ // If namespace is enabled, colon is not allowed in the first 6
+
+ if (getScanner()->getDoNamespaces() && *valPtr == chColon &&
firstNameChar)
+ getScanner()->emitError(XMLErrs::ColonNotLegalWithNS);
if (!XMLReader::isNameChar(*valPtr))
{
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]