/** * Returns whether the given attribute is available or not. * * @see org.w3c.dom.Element#hasAttributeNS(String, String) */ public boolean hasAttributeNS(String namespaceURI, String localName) { return this.getAttributeNodeNS(namespaceURI, localName) != null; }
/** * Retrieves an attribute value by local name and namespace URI. * * @see org.w3c.dom.Element#getAttributeNS(String, String) */ public String getAttributeNS(String namespaceURI, String localName) { if (this.attributes == null) { return ""; } Attr attributeNodeNS = this.getAttributeNodeNS(namespaceURI, localName); return attributeNodeNS == null ? "" : attributeNodeNS.getValue(); }
/** * Returns a named attribute if present. * * @see org.apache.axiom.om.OMElement#getAttribute (javax.xml.namespace.QName) */ public OMAttribute getAttribute(QName qname) { if (this.attributes == null) { return null; } if (qname.getNamespaceURI() == null || qname.getNamespaceURI().equals("")) { return (AttrImpl) this.getAttributeNode(qname.getLocalPart()); } else { return (AttrImpl) this.getAttributeNodeNS(qname.getNamespaceURI(), qname.getLocalPart()); } }
public void setIdAttributeNS(String namespaceURI, String localName, boolean isId) throws DOMException { if (this.isReadonly()) { String msg = DOMMessageFormatter.formatMessage( DOMMessageFormatter.DOM_DOMAIN, "NO_MODIFICATION_ALLOWED_ERR", null); throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, msg); } //find the attr AttrImpl tempAttr = (AttrImpl) this.getAttributeNodeNS(namespaceURI, localName); if (tempAttr == null) { String msg = DOMMessageFormatter.formatMessage( DOMMessageFormatter.DOM_DOMAIN, "NOT_FOUND_ERR", null); throw new DOMException(DOMException.NOT_FOUND_ERR, msg); } this.updateIsId(isId, tempAttr); }
Attr attributeNode = this.getAttributeNodeNS(namespaceURI, DOMUtil .getLocalName(qualifiedName)); if (attributeNode != null) {