List of utility methods to do XML Attribute By QName
Attr | getAttribute(Element el, QName attributeName) The method returns attribute node by the given qname. if (el == null) throw new IllegalArgumentException("Element can not be NULL"); if (attributeName == null) throw new IllegalArgumentException("Attribute name can not be NULL"); String nsURI = attributeName.getNamespaceURI(); String localPart = attributeName.getLocalPart(); if (localPart == null) throw new IllegalArgumentException("Local part of the attribute name can not be NULL"); ... |
String | getAttribute(Element xml, QName qname) get Attribute String uri = qname.getNamespaceURI(); String name = qname.getLocalPart(); String value = xml.getAttributeNS(uri, name); if (value != null && value.length() == 0) return null; return value; |
QName | getAttributeAsQName(XMLStreamReader reader, String name) Returns the QName value of an attribute. String qname = reader.getAttributeValue(null, name);
return getValueAsQName(reader, qname);
|
String | getAttributeValue(final XMLStreamReader streamReader, final QName name) Get the value of the specified attribute. return streamReader.getAttributeValue(name.getNamespaceURI(), name.getLocalPart());
|
QName | getAttributeValueAsQName(final Element el, final String attrName) get Attribute Value As Q Name return getAttributeValueAsQName(el, new QName(attrName)); |