The list of methods to do XML Attribute Parse are organized into topic(s).
Map
parseAttributeValuePairTags(Node parentNode) parse Attribute Value Pair Tags
NodeList avList = parentNode.getChildNodes();
Map map = null;
int numAVPairs = avList.getLength();
if (numAVPairs <= 0) {
return EMPTY_MAP;
for (int l = 0; l < numAVPairs; l++) {
Node avPair = avList.item(l);
...
Boolean
parseBoolean(String xmlAttributeValue, Boolean invalidValue) parse Boolean
if (xmlAttributeValue == null)
return invalidValue;
if (xmlAttributeValue.equals(Boolean.TRUE.toString())) {
return Boolean.TRUE;
} else if (xmlAttributeValue.equals(Boolean.FALSE.toString())) {
return Boolean.FALSE;
} else {
return invalidValue;
...
String[]
parseConfigAttr(NamedNodeMap attributes) parse Config Attr
String key = attributes.getNamedItem("key").getTextContent();
String value = attributes.getNamedItem("value").getTextContent();
return new String[] { key, value };
String
parseElementAttributes(Element element) Aggregates all attributes from the given element, formats then into the proper key="value" XML format and returns them as one String
if (element.hasAttributes() == false) {
return null;
StringBuffer buffer = new StringBuffer();
NamedNodeMap attributeMap = element.getAttributes();
for (int i = 0; i < attributeMap.getLength(); i++) {
Node node = attributeMap.item(i);
if (node.getNodeType() == Node.ATTRIBUTE_NODE) {
...
float
parseFloat(String attributeName, NamedNodeMap map) Parses the value of the given attribute as a float.
org.w3c.dom.Node attr = map.getNamedItem(attributeName);
try {
return attr != null ? Float.parseFloat(attr.getTextContent()) : 0f;
} catch (NumberFormatException ex) {
return 0.0f;
void
parseProtoypes(Node module, Node iFace, PrintWriter out, boolean onlyAttributes) Parse and write an interface with prototypes
String outline = "";
Node child = null;
writeDescription(out, iFace, " ");
String interFaceName = getAttributeValue(iFace, "name");
out.println(" " + interFaceName + " = function () {");
out.println(" //TODO implement constructor logic if needed!");
out.println();
ArrayList<Node> attributes = getNodesByName("Attribute", iFace.getChildNodes());
...