use of org.apache.xpath.NodeSet in project robovm by robovm.
the class DTMNodeProxy method getElementsByTagNameNS.
/**
*
* @param namespaceURI
* @param localName
*
*
* @see org.w3c.dom.Document as of DOM Level 2
*/
public final NodeList getElementsByTagNameNS(String namespaceURI, String localName) {
Vector listVector = new Vector();
Node retNode = dtm.getNode(node);
if (retNode != null) {
boolean isNamespaceURIWildCard = "*".equals(namespaceURI);
boolean isLocalNameWildCard = "*".equals(localName);
if (DTM.ELEMENT_NODE == retNode.getNodeType()) {
NodeList nodeList = retNode.getChildNodes();
for (int i = 0; i < nodeList.getLength(); i++) {
traverseChildren(listVector, nodeList.item(i), namespaceURI, localName, isNamespaceURIWildCard, isLocalNameWildCard);
}
} else if (DTM.DOCUMENT_NODE == retNode.getNodeType()) {
traverseChildren(listVector, dtm.getNode(node), namespaceURI, localName, isNamespaceURIWildCard, isLocalNameWildCard);
}
}
int size = listVector.size();
NodeSet nodeSet = new NodeSet(size);
for (int i = 0; i < size; i++) {
nodeSet.addNode((Node) listVector.elementAt(i));
}
return (NodeList) nodeSet;
}
use of org.apache.xpath.NodeSet in project robovm by robovm.
the class DTMNodeProxy method getElementsByTagName.
/**
*
* @param tagname
*
*
* @see org.w3c.dom.Document
*/
public final NodeList getElementsByTagName(String tagname) {
Vector listVector = new Vector();
Node retNode = dtm.getNode(node);
if (retNode != null) {
boolean isTagNameWildCard = "*".equals(tagname);
if (DTM.ELEMENT_NODE == retNode.getNodeType()) {
NodeList nodeList = retNode.getChildNodes();
for (int i = 0; i < nodeList.getLength(); i++) {
traverseChildren(listVector, nodeList.item(i), tagname, isTagNameWildCard);
}
} else if (DTM.DOCUMENT_NODE == retNode.getNodeType()) {
traverseChildren(listVector, dtm.getNode(node), tagname, isTagNameWildCard);
}
}
int size = listVector.size();
NodeSet nodeSet = new NodeSet(size);
for (int i = 0; i < size; i++) {
nodeSet.addNode((Node) listVector.elementAt(i));
}
return (NodeList) nodeSet;
}
use of org.apache.xpath.NodeSet in project j2objc by google.
the class DTMNodeProxy method getElementsByTagName.
/**
*
* @param tagname
*
*
* @see org.w3c.dom.Document
*/
public final NodeList getElementsByTagName(String tagname) {
Vector listVector = new Vector();
Node retNode = dtm.getNode(node);
if (retNode != null) {
boolean isTagNameWildCard = "*".equals(tagname);
if (DTM.ELEMENT_NODE == retNode.getNodeType()) {
NodeList nodeList = retNode.getChildNodes();
for (int i = 0; i < nodeList.getLength(); i++) {
traverseChildren(listVector, nodeList.item(i), tagname, isTagNameWildCard);
}
} else if (DTM.DOCUMENT_NODE == retNode.getNodeType()) {
traverseChildren(listVector, dtm.getNode(node), tagname, isTagNameWildCard);
}
}
int size = listVector.size();
NodeSet nodeSet = new NodeSet(size);
for (int i = 0; i < size; i++) {
nodeSet.addNode((Node) listVector.elementAt(i));
}
return (NodeList) nodeSet;
}
use of org.apache.xpath.NodeSet in project j2objc by google.
the class DTMNodeProxy method getElementsByTagNameNS.
/**
*
* @param namespaceURI
* @param localName
*
*
* @see org.w3c.dom.Document as of DOM Level 2
*/
public final NodeList getElementsByTagNameNS(String namespaceURI, String localName) {
Vector listVector = new Vector();
Node retNode = dtm.getNode(node);
if (retNode != null) {
boolean isNamespaceURIWildCard = "*".equals(namespaceURI);
boolean isLocalNameWildCard = "*".equals(localName);
if (DTM.ELEMENT_NODE == retNode.getNodeType()) {
NodeList nodeList = retNode.getChildNodes();
for (int i = 0; i < nodeList.getLength(); i++) {
traverseChildren(listVector, nodeList.item(i), namespaceURI, localName, isNamespaceURIWildCard, isLocalNameWildCard);
}
} else if (DTM.DOCUMENT_NODE == retNode.getNodeType()) {
traverseChildren(listVector, dtm.getNode(node), namespaceURI, localName, isNamespaceURIWildCard, isLocalNameWildCard);
}
}
int size = listVector.size();
NodeSet nodeSet = new NodeSet(size);
for (int i = 0; i < size; i++) {
nodeSet.addNode((Node) listVector.elementAt(i));
}
return (NodeList) nodeSet;
}