You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by an...@apache.org on 2001/10/18 06:42:40 UTC
cvs commit: xml-xerces/java/src/org/apache/xerces/impl/msg XMLMessages.properties
andyc 01/10/17 21:42:40
Modified: java/src/org/apache/xerces/impl XMLNamespaceBinder.java
java/src/org/apache/xerces/impl/msg XMLMessages.properties
Log:
Fixed bug in namespace binder that allowed prefixed attribute
names (e.g. "xmlns:"+NCName) to have an empty value. This in
turn caused other misleading errors to be reported.
Reported by: Joe Kesselman
Revision Changes Path
1.7 +9 -1 xml-xerces/java/src/org/apache/xerces/impl/XMLNamespaceBinder.java
Index: XMLNamespaceBinder.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/XMLNamespaceBinder.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- XMLNamespaceBinder.java 2001/10/02 06:07:17 1.6
+++ XMLNamespaceBinder.java 2001/10/18 04:42:39 1.7
@@ -93,7 +93,7 @@
*
* @author Andy Clark, IBM
*
- * @version $Id: XMLNamespaceBinder.java,v 1.6 2001/10/02 06:07:17 andyc Exp $
+ * @version $Id: XMLNamespaceBinder.java,v 1.7 2001/10/18 04:42:39 andyc Exp $
*/
public class XMLNamespaceBinder
implements XMLComponent, XMLDocumentFilter {
@@ -722,6 +722,14 @@
prefix = localpart != fXmlnsSymbol ? localpart : fEmptySymbol;
String uri = attributes.getValue(i);
uri = fSymbolTable.addSymbol(uri);
+
+ // http://www.w3.org/TR/1999/REC-xml-names-19990114/#dt-prefix
+ if (uri == fEmptySymbol) {
+ fErrorReporter.reportError(XMLMessageFormatter.XMLNS_DOMAIN,
+ "EmptyPrefixedAttName",
+ new Object[]{element.rawname},
+ XMLErrorReporter.SEVERITY_FATAL_ERROR);
+ }
// declare prefix in context
fNamespaceSupport.declarePrefix(prefix, uri.length() != 0 ? uri : null);
1.4 +1 -0 xml-xerces/java/src/org/apache/xerces/impl/msg/XMLMessages.properties
Index: XMLMessages.properties
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/msg/XMLMessages.properties,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- XMLMessages.properties 2001/09/25 06:08:32 1.3
+++ XMLMessages.properties 2001/10/18 04:42:40 1.4
@@ -251,6 +251,7 @@
# 4. Using Qualified Names
ElementPrefixUnbound = The prefix \"{0}\" for element \"{1}\" is not bound.
AttributePrefixUnbound = The prefix \"{0}\" for attribute \"{1}\" is not bound.
+ EmptyPrefixedAttName = The value of the attribute \"{0}\" is invalid. Prefixed namespace bindings may not be empty.
PrefixDeclared = The namespace prefix \"{0}\" was not declared.
MSG_ATT_DEFAULT_INVALID = The defaultValue \"{1}\" of attribute \"{0}\" is not legal as for the lexical constraints of this attribute type.
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org