public IndexedAttributeList(Iterator attrs, Iterator namespaces) {
this.attributes = new ArrayList<Attribute>();
while(namespaces.hasNext()) {
Namespace next = (Namespace)namespaces.next();
String uri = XMLConstants.XMLNS_URL;
String localName = next.getPrefix();
String qName;
if(null == localName || localName.length() == 0) {
localName = XMLConstants.XMLNS;
qName = XMLConstants.XMLNS;
} else {
qName = XMLConstants.XMLNS + XMLConstants.COLON + localName;
}
String value = next.getNamespaceURI();
attributes.add(new Attribute(uri, localName, qName, value));
}
while(attrs.hasNext()) {
javax.xml.stream.events.Attribute next = (javax.xml.stream.events.Attribute)attrs.next();
String uri = next.getName().getNamespaceURI();
String localName = next.getName().getLocalPart();
String prefix = next.getName().getPrefix();
String qName;
if(null == prefix || prefix.length() == 0) {
qName = localName;
} else {
qName = prefix + XMLConstants.COLON + localName;
}
String value = next.getValue();
attributes.add(new Attribute(uri, localName, qName, value));
}
}