Code example for QName

Methods: getLocalPart

0
        private final Element element;
        public ElementVariableResolver(Element element) {
            this.element = element;
        } 
        public Object resolveVariable(QName variableName) {
            return element.getAttribute("var:" + variableName.getLocalPart());
        } 
    } 
 
    private static List<Element> elementsOf(NodeList nodeList) {
        List<Element> result = new ArrayList<Element>();
        for (int i = 0; i < nodeList.getLength(); i++) {
            Node node = nodeList.item(i);
            if (node instanceof Element) {
                result.add((Element) node);
            } 
        } 
        return result;
    } 
}