jkesselm 01/12/21 06:08:00
Modified: java/src/org/apache/xml/utils AttList.java
Log:
Bugzilla 5496; previously unimplemented functions.
Revision Changes Path
1.7 +20 -4 xml-xalan/java/src/org/apache/xml/utils/AttList.java
Index: AttList.java
===================================================================
RCS file: /home/cvs/xml-xalan/java/src/org/apache/xml/utils/AttList.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- AttList.java 2001/12/14 15:30:29 1.6
+++ AttList.java 2001/12/21 14:08:00 1.7
@@ -259,18 +259,34 @@
*/
public int getIndex(String uri, String localPart)
{
- return 0;
+ for(int i=m_attrs.getLength()-1;i>=0;--i)
+ {
+ Node a=m_attrs.item(i);
+ String u=a.getNamespaceURI();
+ if( (u==null ? uri==null : u.equals(uri))
+ &&
+ a.getLocalName().equals(localPart) )
+ return i;
+ }
+ return -1;
}
/**
* Look up the index of an attribute by raw XML 1.0 name.
*
- * @param rawName The raw (prefixed) name.
+ * @param qName The qualified (prefixed) name.
* @return The index of the attribute, or -1 if it does not
* appear in the list.
*/
- public int getIndex(String rawName)
+ public int getIndex(String qName)
{
- return 0;
+ for(int i=m_attrs.getLength()-1;i>=0;--i)
+ {
+ Node a=m_attrs.item(i);
+ if(a.getNodeName().equals(qName) )
+ return i;
+ }
+ return -1;
}
}
+
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]