sboag 00/12/31 01:25:38
Modified: java/src/org/apache/xml/utils MutableAttrListImpl.java
Log:
Fix strange problem where getIndex(uri, localName) didn't seem
to be working in addAttribute (for xmlns), use the QName instead,
which should be fine in this limited instance, since prefixes will
always be the same within a single attribute list (we're just checking
for duplicates).
Revision Changes Path
1.3 +7 -2
xml-xalan/java/src/org/apache/xml/utils/MutableAttrListImpl.java
Index: MutableAttrListImpl.java
===================================================================
RCS file:
/home/cvs/xml-xalan/java/src/org/apache/xml/utils/MutableAttrListImpl.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- MutableAttrListImpl.java 2000/11/30 22:58:48 1.2
+++ MutableAttrListImpl.java 2000/12/31 09:25:38 1.3
@@ -118,7 +118,12 @@
if (null == uri)
uri = "";
- int index = this.getIndex(uri, localName);
+ // getIndex(qName) seems to be more reliable than getIndex(uri,
localName),
+ // in the case of the xmlns attribute anyway.
+ int index = this.getIndex(qName);
+ // int index = this.getIndex(uri, localName);
+
+ // System.out.println("MutableAttrListImpl#addAttribute:
"+uri+":"+localName+", "+index+", "+qName+", "+this);
if (index >= 0)
this.setAttribute(index, uri, localName, qName, type, value);
@@ -146,7 +151,7 @@
String localName = atts.getLocalName(i);
String qname = atts.getQName(i);
int index = this.getIndex(uri, localName);
-
+ // System.out.println("MutableAttrListImpl#addAttributes:
"+uri+":"+localName+", "+index+", "+atts.getQName(i)+", "+this);
if (index >= 0)
this.setAttribute(index, uri, localName, qname, atts.getType(i),
atts.getValue(i));