You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by mr...@apache.org on 2008/12/31 21:51:25 UTC
svn commit: r730475 -
/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/stax/events/NamespaceImpl.java
Author: mrglavas
Date: Wed Dec 31 12:51:25 2008
New Revision: 730475
URL: http://svn.apache.org/viewvc?rev=730475&view=rev
Log:
Fixing a bug. The QName created for the default namespace was incorrect.
Modified:
xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/stax/events/NamespaceImpl.java
Modified: xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/stax/events/NamespaceImpl.java
URL: http://svn.apache.org/viewvc/xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/stax/events/NamespaceImpl.java?rev=730475&r1=730474&r2=730475&view=diff
==============================================================================
--- xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/stax/events/NamespaceImpl.java (original)
+++ xerces/java/branches/xml-schema-1.1-dev/src/org/apache/xerces/stax/events/NamespaceImpl.java Wed Dec 31 12:51:25 2008
@@ -17,6 +17,7 @@
package org.apache.xerces.stax.events;
+import javax.xml.XMLConstants;
import javax.xml.namespace.QName;
import javax.xml.stream.Location;
import javax.xml.stream.events.Namespace;
@@ -41,7 +42,7 @@
*/
public NamespaceImpl(final String prefix, final String namespaceURI, final Location location) {
super(NAMESPACE, makeAttributeQName(prefix), namespaceURI, null, true, location);
- fPrefix = (prefix == null ? "" : prefix);
+ fPrefix = (prefix == null) ? XMLConstants.DEFAULT_NS_PREFIX : prefix;
fNamespaceURI = namespaceURI;
}
@@ -50,8 +51,8 @@
* @return A QName for the attribute that declares this namespace.
*/
private static QName makeAttributeQName(String prefix) {
- if (prefix == null) {
- return new QName("", "xmlns", "");
+ if (prefix == null || prefix.equals(XMLConstants.DEFAULT_NS_PREFIX)) {
+ return new QName(NamespaceContext.XMLNS_URI, "xmlns", "");
}
return new QName(NamespaceContext.XMLNS_URI, prefix, "xmlns");
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xerces.apache.org
For additional commands, e-mail: commits-help@xerces.apache.org