Here you can find the source of getHeadAttr(Element annotU, String attrName)
public static String getHeadAttr(Element annotU, String attrName)
//package com.java2s; //License from project: Open Source License import org.w3c.dom.Element; import org.w3c.dom.NodeList; public class Main { public static String getHeadAttr(Element annotU, String attrName) { NodeList nl = annotU.getElementsByTagName("head"); if (nl == null) return ""; Element head = (Element) nl.item(0); if (head == null) return ""; NodeList notes = head.getElementsByTagName("note"); for (int i = 0; i < notes.getLength(); i++) { Element e = (Element) (notes.item(i)); String a = e.getAttribute("type"); if (a.equals(attrName)) return e.getTextContent(); }/* w w w .j a v a 2 s. com*/ return ""; } }