Open zebrada opened 5 years ago
Alternative is :
private static String getAttributeValueByLocalName(XMLStreamReader2 element, String localName) {
for (int i = 0; i < element.getAttributeCount(); i++) {
if(localName.equals(element.getAttributeLocalName(i))) {
return element.getAttributeValue(i);
}
}
return null;
}
This is way less attractive.
Stax javadoc says :
That's not the behavior implemented by com.fasterxml.aalto.stax.StreamReaderImpl If namespace is set at null StreamReaderImpl checks if the localValue of the attribute has no namespace.
Why would you do that, making a useful method so useless ?