sandygao 2002/08/14 10:52:52
Modified: java/src/org/apache/xerces/dom DOMNormalizer.java
java/src/org/apache/xerces/impl XMLNamespaceBinder.java
java/src/org/apache/xerces/impl/xs/traversers
XSDocumentInfo.java
java/src/org/apache/xerces/parsers AbstractDOMParser.java
java/src/org/apache/xerces/util NamespaceSupport.java
XMLSymbols.java
java/src/org/apache/xerces/xni NamespaceContext.java
java/src/org/apache/xml/serialize XMLSerializer.java
Log:
Shouldn't have moved the string constants from xni.NamespaceContext to
util.XMLSymbols. Those are public fields, hence part of the XNI API. Moving
them would break some applications that use those constants.
Revision Changes Path
1.10 +6 -6 xml-xerces/java/src/org/apache/xerces/dom/DOMNormalizer.java
Index: DOMNormalizer.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/dom/DOMNormalizer.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- DOMNormalizer.java 13 Aug 2002 22:57:08 -0000 1.9
+++ DOMNormalizer.java 14 Aug 2002 17:52:52 -0000 1.10
@@ -557,7 +557,7 @@
for (int k=0; k < attributes.getLength(); k++) {
Attr attr = (Attr)attributes.getItem(k);
uri = attr.getNamespaceURI();
- if (uri != null && uri.equals(XMLSymbols.XMLNS_URI)) {
+ if (uri != null && uri.equals(NamespaceSupport.XMLNS_URI)) {
// namespace attribute
value = attr.getNodeValue();
if (value == null) {
@@ -565,7 +565,7 @@
}
// Check for invalid namespace declaration:
- if (value.equals(XMLSymbols.XMLNS_URI)) {
+ if (value.equals(NamespaceSupport.XMLNS_URI)) {
if (fErrorHandler != null) {
modifyDOMError("No prefix other than 'xmlns' can be
bound to 'http://www.w3.org/2000/xmlns/' namespace name",
DOMError.SEVERITY_ERROR, attr);
@@ -724,7 +724,7 @@
// ---------------------------------------
// REVISIT: can we assume that "uri" is from some symbol
// table, and compare by reference? -SG
- if (uri != null && uri.equals(XMLSymbols.XMLNS_URI)) {
+ if (uri != null && uri.equals(NamespaceSupport.XMLNS_URI)) {
continue;
}
@@ -844,12 +844,12 @@
if (DEBUG) {
System.out.println("=>add xmlns=\""+uri+"\" declaration");
}
- element.setAttributeNS(XMLSymbols.XMLNS_URI, XMLSymbols.PREFIX_XMLNS,
uri);
+ element.setAttributeNS(NamespaceSupport.XMLNS_URI,
XMLSymbols.PREFIX_XMLNS, uri);
} else {
if (DEBUG) {
System.out.println("=>add xmlns:"+prefix+"=\""+uri+"\"
declaration");
}
- element.setAttributeNS(XMLSymbols.XMLNS_URI, "xmlns:"+prefix, uri);
+ element.setAttributeNS(NamespaceSupport.XMLNS_URI, "xmlns:"+prefix,
uri);
}
}
1.19 +4 -4
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.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- XMLNamespaceBinder.java 13 Aug 2002 22:57:08 -0000 1.18
+++ XMLNamespaceBinder.java 14 Aug 2002 17:52:52 -0000 1.19
@@ -749,7 +749,7 @@
}
// 2. the namespace for "xmlns" can't be bound to any prefix
- if (uri == XMLSymbols.XMLNS_URI) {
+ if (uri == NamespaceContext.XMLNS_URI) {
fErrorReporter.reportError(XMLMessageFormatter.XMLNS_DOMAIN,
"CantBindXMLNS",
new Object[]{attributes.getQName(i)},
@@ -758,7 +758,7 @@
// 3. "xml" can't be bound to any other namespace than it's own
if (localpart == XMLSymbols.PREFIX_XML) {
- if (uri != XMLSymbols.XML_URI) {
+ if (uri != NamespaceContext.XML_URI) {
fErrorReporter.reportError(XMLMessageFormatter.XMLNS_DOMAIN,
"CantBindXML",
new
Object[]{attributes.getQName(i)},
@@ -767,7 +767,7 @@
}
// 4. the namespace for "xml" can't be bound to any other prefix
else {
- if (uri ==XMLSymbols.XML_URI) {
+ if (uri ==NamespaceContext.XML_URI) {
fErrorReporter.reportError(XMLMessageFormatter.XMLNS_DOMAIN,
"CantBindXML",
new
Object[]{attributes.getQName(i)},
1.13 +3 -3
xml-xerces/java/src/org/apache/xerces/impl/xs/traversers/XSDocumentInfo.java
Index: XSDocumentInfo.java
===================================================================
RCS file:
/home/cvs/xml-xerces/java/src/org/apache/xerces/impl/xs/traversers/XSDocumentInfo.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- XSDocumentInfo.java 13 Aug 2002 22:57:11 -0000 1.12
+++ XSDocumentInfo.java 14 Aug 2002 17:52:52 -0000 1.13
@@ -123,7 +123,7 @@
// During XML Schema traversal bind "xml" prefix to
// "http://www.w3.org/XML/1998/namespace"
// per Namespace Constraint: Prefix Declared (Namespaces in XML REC)
- fNamespaceSupport.declarePrefix(XMLSymbols.PREFIX_XML, XMLSymbols.XML_URI);
+ fNamespaceSupport.declarePrefix(XMLSymbols.PREFIX_XML,
SchemaNamespaceSupport.XML_URI);
if(schemaDoc != null) {
Element root = DOMUtil.getRoot(schemaDoc);
@@ -170,7 +170,7 @@
// per Namespace Constraint: Prefix Declared (Namespaces in XML REC)
// REVISIT: shouldn't this work be done whenever a namespace support
// object is constructed?
- fNamespaceSupport.declarePrefix(XMLSymbols.PREFIX_XML, XMLSymbols.XML_URI);
+ fNamespaceSupport.declarePrefix(XMLSymbols.PREFIX_XML,
SchemaNamespaceSupport.XML_URI);
fValidationContext.setNamespaceSupport(fNamespaceSupport);
}
1.69 +2 -3
xml-xerces/java/src/org/apache/xerces/parsers/AbstractDOMParser.java
Index: AbstractDOMParser.java
===================================================================
RCS file:
/home/cvs/xml-xerces/java/src/org/apache/xerces/parsers/AbstractDOMParser.java,v
retrieving revision 1.68
retrieving revision 1.69
diff -u -r1.68 -r1.69
--- AbstractDOMParser.java 13 Aug 2002 22:57:11 -0000 1.68
+++ AbstractDOMParser.java 14 Aug 2002 17:52:52 -0000 1.69
@@ -78,7 +78,6 @@
import org.apache.xerces.impl.xs.psvi.XSAttributeDeclaration;
import org.apache.xerces.impl.dv.XSSimpleType;
-import org.apache.xerces.util.XMLSymbols;
import org.apache.xerces.xni.Augmentations;
import org.apache.xerces.xni.NamespaceContext;
import org.apache.xerces.xni.QName;
@@ -2341,7 +2340,7 @@
// done here.
if (attributeName.startsWith("xmlns:") ||
attributeName.equals("xmlns")) {
- namespaceURI = XMLSymbols.XMLNS_URI;
+ namespaceURI = NamespaceContext.XMLNS_URI;
}
attr = (AttrImpl)fDocumentImpl.createAttributeNS(namespaceURI,
attributeName);
1.11 +3 -3 xml-xerces/java/src/org/apache/xerces/util/NamespaceSupport.java
Index: NamespaceSupport.java
===================================================================
RCS file:
/home/cvs/xml-xerces/java/src/org/apache/xerces/util/NamespaceSupport.java,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- NamespaceSupport.java 13 Aug 2002 22:57:11 -0000 1.10
+++ NamespaceSupport.java 14 Aug 2002 17:52:52 -0000 1.11
@@ -156,10 +156,10 @@
// bind "xml" prefix to the XML uri
fNamespace[fNamespaceSize++] = XMLSymbols.PREFIX_XML;
- fNamespace[fNamespaceSize++] = XMLSymbols.XML_URI;
+ fNamespace[fNamespaceSize++] = XML_URI;
// bind "xmlns" prefix to the XMLNS uri
fNamespace[fNamespaceSize++] = XMLSymbols.PREFIX_XMLNS;
- fNamespace[fNamespaceSize++] = XMLSymbols.XMLNS_URI;
+ fNamespace[fNamespaceSize++] = XMLNS_URI;
++fCurrentContext;
} // reset(SymbolTable)
1.2 +1 -14 xml-xerces/java/src/org/apache/xerces/util/XMLSymbols.java
Index: XMLSymbols.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/util/XMLSymbols.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- XMLSymbols.java 13 Aug 2002 22:57:11 -0000 1.1
+++ XMLSymbols.java 14 Aug 2002 17:52:52 -0000 1.2
@@ -87,22 +87,9 @@
public final static String PREFIX_XML = "xml".intern();
/**
- * The XML Namespace ("http://www.w3.org/XML/1998/namespace"). This is
- * the Namespace URI that is automatically mapped to the "xml" prefix.
- */
- public final static String XML_URI =
"http://www.w3.org/XML/1998/namespace".intern();
-
- /**
* The internalized "xmlns" prefix.
*/
public final static String PREFIX_XMLNS = "xmlns".intern();
-
- /**
- * XML Information Set REC
- * all namespace attributes (including those named xmlns,
- * whose [prefix] property has no value) have a namespace URI of
http://www.w3.org/2000/xmlns/
- */
- public final static String XMLNS_URI = "http://www.w3.org/2000/xmlns/".intern();
//==========================
// DTD symbols
1.7 +18 -1 xml-xerces/java/src/org/apache/xerces/xni/NamespaceContext.java
Index: NamespaceContext.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/xni/NamespaceContext.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- NamespaceContext.java 13 Aug 2002 22:57:11 -0000 1.6
+++ NamespaceContext.java 14 Aug 2002 17:52:52 -0000 1.7
@@ -67,6 +67,23 @@
public interface NamespaceContext {
//
+ // Constants
+ //
+
+ /**
+ * The XML Namespace ("http://www.w3.org/XML/1998/namespace"). This is
+ * the Namespace URI that is automatically mapped to the "xml" prefix.
+ */
+ public final static String XML_URI =
"http://www.w3.org/XML/1998/namespace".intern();
+
+ /**
+ * XML Information Set REC
+ * all namespace attributes (including those named xmlns,
+ * whose [prefix] property has no value) have a namespace URI of
http://www.w3.org/2000/xmlns/
+ */
+ public final static String XMLNS_URI = "http://www.w3.org/2000/xmlns/".intern();
+
+ //
// NamespaceContext methods
//
1.41 +4 -4 xml-xerces/java/src/org/apache/xml/serialize/XMLSerializer.java
Index: XMLSerializer.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xml/serialize/XMLSerializer.java,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -r1.40 -r1.41
--- XMLSerializer.java 13 Aug 2002 23:03:13 -0000 1.40
+++ XMLSerializer.java 14 Aug 2002 17:52:52 -0000 1.41
@@ -773,14 +773,14 @@
attr = (Attr) attrMap.item( i );
uri = attr.getNamespaceURI();
// check if attribute is a namespace decl
- if (uri != null && uri.equals(XMLSymbols.XMLNS_URI)) {
+ if (uri != null && uri.equals(NamespaceSupport.XMLNS_URI)) {
value = attr.getNodeValue();
if (value == null) {
value=XMLSymbols.EMPTY_STRING;
}
- if (value.equals(XMLSymbols.XMLNS_URI)) {
+ if (value.equals(NamespaceSupport.XMLNS_URI)) {
if (fDOMErrorHandler != null) {
modifyDOMError("No prefix other than 'xmlns' can be
bound to 'http://www.w3.org/2000/xmlns/' namespace name",
DOMError.SEVERITY_ERROR, attr);
@@ -954,7 +954,7 @@
// ---------------------------------------------------
// print namespace declarations namespace declarations
// ---------------------------------------------------
- if (uri != null && uri.equals(XMLSymbols.XMLNS_URI)) {
+ if (uri != null && uri.equals(NamespaceSupport.XMLNS_URI)) {
// check if we need to output this declaration
prefix = attr.getPrefix();
prefix = (prefix == null ||
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]