elena 2003/02/17 10:06:29
Modified: java/src/org/apache/xerces/dom DOMNormalizer.java
java/src/org/apache/xerces/util NamespaceSupport.java
java/src/org/apache/xml/serialize XMLSerializer.java
Log:
Fixing reference to the constants defined in the xni.NamespaceContext interfaces.
Patch submitter: Ville Skytt�
(http://nagoya.apache.org/bugzilla/show_bug.cgi?id=12502)
Revision Changes Path
1.29 +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.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- DOMNormalizer.java 10 Feb 2003 19:10:04 -0000 1.28
+++ DOMNormalizer.java 17 Feb 2003 18:06:26 -0000 1.29
@@ -573,7 +573,7 @@
for (int k=0; k < attributes.getLength(); k++) {
Attr attr = (Attr)attributes.getItem(k);
uri = attr.getNamespaceURI();
- if (uri != null && uri.equals(NamespaceSupport.XMLNS_URI)) {
+ if (uri != null && uri.equals(NamespaceContext.XMLNS_URI)) {
// namespace attribute
value = attr.getNodeValue();
if (value == null) {
@@ -581,7 +581,7 @@
}
// Check for invalid namespace declaration:
- if (value.equals(NamespaceSupport.XMLNS_URI)) {
+ if (value.equals(NamespaceContext.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);
@@ -722,7 +722,7 @@
// ---------------------------------------
// REVISIT: can we assume that "uri" is from some symbol
// table, and compare by reference? -SG
- if (uri != null && uri.equals(NamespaceSupport.XMLNS_URI)) {
+ if (uri != null && uri.equals(NamespaceContext.XMLNS_URI)) {
continue;
}
@@ -848,12 +848,12 @@
if (DEBUG) {
System.out.println("=>add xmlns=\""+uri+"\" declaration");
}
- element.setAttributeNS(NamespaceSupport.XMLNS_URI,
XMLSymbols.PREFIX_XMLNS, uri);
+ element.setAttributeNS(NamespaceContext.XMLNS_URI,
XMLSymbols.PREFIX_XMLNS, uri);
} else {
if (DEBUG) {
System.out.println("=>add xmlns:"+prefix+"=\""+uri+"\"
declaration");
}
- element.setAttributeNS(NamespaceSupport.XMLNS_URI, "xmlns:"+prefix,
uri);
+ element.setAttributeNS(NamespaceContext.XMLNS_URI, "xmlns:"+prefix,
uri);
}
}
1.15 +13 -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.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- NamespaceSupport.java 16 Dec 2002 01:26:21 -0000 1.14
+++ NamespaceSupport.java 17 Feb 2003 18:06:27 -0000 1.15
@@ -150,10 +150,10 @@
// bind "xml" prefix to the XML uri
fNamespace[fNamespaceSize++] = XMLSymbols.PREFIX_XML;
- fNamespace[fNamespaceSize++] = XML_URI;
+ fNamespace[fNamespaceSize++] = NamespaceContext.XML_URI;
// bind "xmlns" prefix to the XMLNS uri
fNamespace[fNamespaceSize++] = XMLSymbols.PREFIX_XMLNS;
- fNamespace[fNamespaceSize++] = XMLNS_URI;
+ fNamespace[fNamespaceSize++] = NamespaceContext.XMLNS_URI;
++fCurrentContext;
} // reset(SymbolTable)
@@ -330,6 +330,16 @@
}
throw new NoSuchElementException("Illegal access to Namespace
prefixes enumeration.");
}
+
+ public String toString(){
+ StringBuffer buf = new StringBuffer();
+ for (int i=0;i<size;i++){
+ buf.append(prefixes[i]);
+ buf.append(" ");
+ }
+
+ return buf.toString();
+ }
}
1.48 +12 -17 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.47
retrieving revision 1.48
diff -u -r1.47 -r1.48
--- XMLSerializer.java 10 Feb 2003 19:07:54 -0000 1.47
+++ XMLSerializer.java 17 Feb 2003 18:06:28 -0000 1.48
@@ -75,31 +75,26 @@
import java.io.IOException;
-import java.io.UnsupportedEncodingException;
import java.io.OutputStream;
import java.io.Writer;
import java.util.Enumeration;
-import org.w3c.dom.Node;
+import org.apache.xerces.dom.DOMMessageFormatter;
+import org.apache.xerces.dom3.DOMError;
+import org.apache.xerces.util.NamespaceSupport;
+import org.apache.xerces.util.SymbolTable;
+import org.apache.xerces.util.XMLChar;
+import org.apache.xerces.util.XMLSymbols;
+import org.apache.xerces.xni.NamespaceContext;
import org.w3c.dom.Attr;
import org.w3c.dom.Element;
import org.w3c.dom.NamedNodeMap;
-
-import org.apache.xerces.dom3.DOMError;
-
-import org.xml.sax.DocumentHandler;
-import org.xml.sax.ContentHandler;
+import org.w3c.dom.Node;
import org.xml.sax.AttributeList;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.AttributesImpl;
-import org.apache.xerces.util.SymbolTable;
-import org.apache.xerces.util.XMLSymbols;
-import org.apache.xerces.util.NamespaceSupport;
-import org.apache.xerces.util.XMLChar;
-import org.apache.xerces.dom.DOMMessageFormatter;
-
/**
* Implements an XML serializer supporting both DOM and SAX pretty
* serializing. For usage instructions see {@link Serializer}.
@@ -785,14 +780,14 @@
attr = (Attr) attrMap.item( i );
uri = attr.getNamespaceURI();
// check if attribute is a namespace decl
- if (uri != null && uri.equals(NamespaceSupport.XMLNS_URI)) {
+ if (uri != null && uri.equals(NamespaceContext.XMLNS_URI)) {
value = attr.getNodeValue();
if (value == null) {
value=XMLSymbols.EMPTY_STRING;
}
- if (value.equals(NamespaceSupport.XMLNS_URI)) {
+ if (value.equals(NamespaceContext.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);
@@ -966,7 +961,7 @@
// ---------------------------------------------------
// print namespace declarations namespace declarations
// ---------------------------------------------------
- if (uri != null && uri.equals(NamespaceSupport.XMLNS_URI)) {
+ if (uri != null && uri.equals(NamespaceContext.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]