/** * Get the named attribute from this element. * @param namespaceURI The namespace URI of the required attribute. * @param attribute The attribute name. * @return The attribute value, or an empty string if the attribute is not specified. * @deprecated Use {@link #getAttributeNS(String, String)}. */ public String getAttribute(String namespaceURI, String attribute) { return getAttributeNS(namespaceURI, attribute); }
/** * Get the named attribute from this element. * @param namespaceURI The namespace URI of the required attribute. * @param attribute The attribute name. * @return The attribute value, or an empty string if the attribute is not specified. * @deprecated Use {@link #getAttributeNS(String, String)}. */ public String getAttribute(String namespaceURI, String attribute) { return getAttributeNS(namespaceURI, attribute); }
/** * Get the named attribute from this element. * @param namespaceURI The namespace URI of the required attribute. * @param attribute The attribute name. * @return The attribute value, or an empty string if the attribute is not specified. * @deprecated Use {@link #getAttributeNS(String, String)}. */ public String getAttribute(String namespaceURI, String attribute) { return getAttributeNS(namespaceURI, attribute); }
/** * Get the named attribute from this element. * @param namespaceURI The namespace URI of the required attribute. * @param attribute The attribute name. * @return The attribute value, or an empty string if the attribute is not specified. * @deprecated Use {@link #getAttributeNS(String, String)}. */ public String getAttribute(String namespaceURI, String attribute) { return getAttributeNS(namespaceURI, attribute); }
public Object getValue(SAXElement element) { String attribValue; if(namespaceURI != null) { attribValue = element.getAttributeNS(namespaceURI, localPart); } else { attribValue = element.getAttribute(localPart); } return decoder.decode(attribValue); }
public Object getValue(SAXElement element) { String attribValue; if(namespaceURI != null) { attribValue = element.getAttributeNS(namespaceURI, localPart); } else { attribValue = element.getAttribute(localPart); } return decoder.decode(attribValue); }
public Object getValue(SAXElement element) { String attribValue; if(namespaceURI != null) { attribValue = element.getAttributeNS(namespaceURI, localPart); } else { attribValue = element.getAttribute(localPart); } return decoder.decode(attribValue); }
public Object getValue(SAXElement element) { String attribValue; if(namespaceURI != null) { attribValue = element.getAttributeNS(namespaceURI, localPart); } else { attribValue = element.getAttribute(localPart); } return decoder.decode(attribValue); }
private void addNamespace(String prefix, String namespaceURI, SAXElement element) { if (prefix == null || namespaceURI == null) { // No namespace. Ignore... return; } else if(prefix.equals(XMLConstants.DEFAULT_NS_PREFIX) && namespaceURI.equals(XMLConstants.NULL_NS_URI)) { // No namespace. Ignore... return; } else { String prefixNS = element.getAttributeNS(XMLConstants.XMLNS_ATTRIBUTE_NS_URI, prefix); if(prefixNS != null && prefixNS.length() != 0) { // Already declared (on the element)... return; } } Attributes attributes = element.getAttributes(); AttributesImpl attributesCopy = new AttributesImpl(); attributesCopy.setAttributes(attributes); if(prefix.length() > 0) { attributesCopy.addAttribute(XMLConstants.XMLNS_ATTRIBUTE_NS_URI, prefix, "xmlns:" + prefix, null, namespaceURI); } else { attributesCopy.addAttribute(XMLConstants.XMLNS_ATTRIBUTE_NS_URI, prefix, "xmlns", null, namespaceURI); } element.setAttributes(attributesCopy); } }
private void addNamespace(String prefix, String namespaceURI, SAXElement element) { if (prefix == null || namespaceURI == null) { // No namespace. Ignore... return; } else if(prefix.equals(XMLConstants.DEFAULT_NS_PREFIX) && namespaceURI.equals(XMLConstants.NULL_NS_URI)) { // No namespace. Ignore... return; } else { String prefixNS = element.getAttributeNS(XMLConstants.XMLNS_ATTRIBUTE_NS_URI, prefix); if(prefixNS != null && prefixNS.length() != 0) { // Already declared (on the element)... return; } } Attributes attributes = element.getAttributes(); AttributesImpl attributesCopy = new AttributesImpl(); attributesCopy.setAttributes(attributes); if(prefix.length() > 0) { attributesCopy.addAttribute(XMLConstants.XMLNS_ATTRIBUTE_NS_URI, prefix, "xmlns:" + prefix, null, namespaceURI); } else { attributesCopy.addAttribute(XMLConstants.XMLNS_ATTRIBUTE_NS_URI, prefix, "xmlns", null, namespaceURI); } element.setAttributes(attributesCopy); } }