# Class: com.pnfsoftware.jeb.core.units.code.android.XmlResourceHelper
- Super class: `java.lang.Object`

This helper class facilitates access to the data contained in an XML resource. In particular, the  `readAttributeXxx` methods allow easy retrieval of attribute values by tag names,  throughout the entire document.

## Constructor: XmlResourceHelper
- parameter: `xml`, type: `com.pnfsoftware.jeb.core.units.IXmlUnit`

Description: Create a helper around the provided XML unit.
parameter: xml: XML unit

## Constructor: XmlResourceHelper
- parameter: `doc`, type: `org.w3c.dom.Document`

Description: Create a helper around the provided low\-level XML document object.
parameter: doc: XML document

## Protected Field: doc
Type: `org.w3c.dom.Document`
Description: Source XML document.

## Protected Field: rootElt
Type: `org.w3c.dom.Element`
Description: Root element of the source document.

## Protected Method: convertEltlist
- parameter: `nodelist`, type: `org.w3c.dom.NodeList`
- return type: `java.util.List<org.w3c.dom.Element>`

Description: Convert a DOM node list to a Java list of elements.
parameter: nodelist: DOM node list of elements
return: the converted list

## Protected Method: convertNodelist
- parameter: `nodelist`, type: `org.w3c.dom.NodeList`
- return type: `java.util.List<org.w3c.dom.Node>`

Description: Convert a DOM node list to a Java list.
parameter: nodelist: DOM node list
return: the converted list

## Method: findElement
- parameter: `tagname`, type: `java.lang.String`
- return type: `org.w3c.dom.Element`


## Method: getRootElement
- return type: `org.w3c.dom.Element`

Description: This low\-level method offers access to the `org.w3c.dom.Element` holding the root.
return: the document root element

## Protected Method: getSimpleName
- parameter: `name`, type: `java.lang.String`
- return type: `java.lang.String`

Description: Remove a namespace prefix from a name.
parameter: name: attribute or element name
return: the simple name

## Method: hasAttributeValue
- parameter: `tagName`, type: `java.lang.String`
- parameter: `attrName`, type: `java.lang.String`
- parameter: `wantedAttrValue`, type: `java.lang.String`
- return type: `boolean`

Description: Determine if a tag has a specific attribute value.  

  Beware: namespaces are ignored. This method should be used for heuristics only.
parameter: tagName: tag name, or null for the root manifest element
parameter: attrName: attribute name
parameter: wantedAttrValue: expected attribute value
return: true if the value is present

## Protected Method: isFullyQualifiedName
- parameter: `name`, type: `java.lang.String`
- return type: `boolean`

Description: Determine if an attribute name includes a namespace prefix.
parameter: name: attribute name
return: true if the name contains a prefix separator

## Protected Method: isSimpleName
- parameter: `name`, type: `java.lang.String`
- return type: `boolean`

Description: Determine if an attribute name has no namespace prefix.
parameter: name: attribute name
return: true if the name is simple

## Protected Method: prepare
- parameter: `doc`, type: `org.w3c.dom.Document`

Description: The default implementation retrieves sets the [#doc](#doc) and [#rootElt](#rootElt) attributes.  Overrides must call this implementation first.
parameter: doc: XML document

## Method: readAttribute
- parameter: `tagName`, type: `java.lang.String`
- parameter: `attrName`, type: `java.lang.String`
- return type: `java.lang.String`

Description: Retrieve the attribute value of the first tag having the provided name.  

  Beware: namespaces are ignored.
parameter: tagName: tag name, or null for the root manifest element
parameter: attrName: attribute name
return: the value \(possibly empty if the attribute is not found in the tag\), or null \(if no          element with the provided tag name was found in the document\)

## Method: readAttributes
- parameter: `tagName`, type: `java.lang.String`
- parameter: `attrName`, type: `java.lang.String`
- return type: `java.util.List<java.lang.String>`

Description: Retrieve the attribute values for all tags having the provided name.  

  Beware: namespaces are ignored. This method should be used for heuristics only.
parameter: tagName: tag name, or null for the root manifest element
parameter: attrName: attribute name
return: a list of non\-null strings

