/** */ public Element getElementById(String id) { if (id == null) return null; NodeIterator it = createNodeIterator(this, NodeFilter.SHOW_ALL, null, false); if (it == null) return null; for (Node node = it.nextNode(); node != null; node = it.nextNode()) { if (node.getNodeType() != ELEMENT_NODE) continue; ElementImpl element = (ElementImpl) node; String value = element.getAttribute("id");//$NON-NLS-1$ if (value != null && value.equals(id)) return element; } return null; }
return new NodeListImpl(); NodeIterator it = createNodeIterator(this, NodeFilter.SHOW_ALL, null, false); if (it == null) return new NodeListImpl();
private NodeListImpl internalGetElementsByTagName(String tagName) { // System.out.println("getElementsByTagname: " + tagName); NodeIterator it = createNodeIterator(this, NodeFilter.SHOW_ALL, null, false); if (it == null) return new NodeListImpl(); NodeListImpl elements = new NodeListImpl(); if (tagName.length() == 1 && tagName.charAt(0) == '*') { tagName = null; // do not care } for (Node node = it.nextNode(); node != null; node = it.nextNode()) { if (node.getNodeType() != ELEMENT_NODE) continue; if (tagName != null) { ElementImpl element = (ElementImpl) node; if (!element.matchTagName(tagName)) continue; } elements.appendNode(node); } if (usetagnamecache) { tagNameCache.addItem(tagName, elements); } return elements; }
if (document == null) return new NodeListImpl(); NodeIterator it = document.createNodeIterator(this, NodeFilter.SHOW_ALL, null, false); if (it == null) return new NodeListImpl();
if (document == null) return new NodeListImpl(); NodeIterator it = document.createNodeIterator(this, NodeFilter.SHOW_ALL, null, false); if (it == null) return new NodeListImpl();