List of utility methods to do XML Node Namespace
boolean | hasNamespaceURI(@Nullable final Node aNode, @Nullable final String sNamespaceURI) has Namespace URI final String sNSURI = aNode == null ? null : aNode.getNamespaceURI(); return sNSURI != null && sNSURI.equals(sNamespaceURI); |
boolean | isAppropriateElement(Node iNode, String iNodeName, String iNamespace) This method determins if a node in the DOM Tree (iNode) is the node we are looking for.
Logger.getLogger("org.adl.util.debug.samplerte").entering("DOMTreeUtility", "isAppropriateElement()"); Logger.getLogger("org.adl.util.debug.samplerte").finest("Input Parent Node: " + iNode.getLocalName()); Logger.getLogger("org.adl.util.debug.samplerte").finest("Input Node being searched for: " + iNodeName); Logger.getLogger("org.adl.util.debug.samplerte") .finest("Input Namespace of node being searched for: " + iNamespace); boolean result = false; if (iNode.getNodeType() == Node.ATTRIBUTE_NODE) { if (iNode.getNamespaceURI() == null) { ... |
boolean | isAppropriateElement(Node iNode, String iNodeName, String iNamespace) This method determins if a node in the DOM Tree (iNode) is the node we are looking for.
boolean result = false; if (iNode.getNodeType() == Node.ATTRIBUTE_NODE) { if (iNode.getNamespaceURI() == null) { String parentsNamespace = ((Attr) iNode).getOwnerElement().getNamespaceURI(); if ((iNode.getLocalName().equals(iNodeName)) && (parentsNamespace.equals(iNamespace))) { result = true; } else { ... |
boolean | isInNamespace(Node node, String namespace) Determines if the given Node belongs to the namespace with the given String name.
return namespace.equals(node.getNamespaceURI());
|
boolean | isInNamespace(Node node, String namespace) Determines if the given Node belongs to the namespace with the given String name.
return namespace.equals(node.getNamespaceURI());
|
boolean | isNamespace(Node node) is Namespace final short nodeType = node.getNodeType(); if (nodeType == Node.ATTRIBUTE_NODE) { final String namespaceURI = node.getNamespaceURI(); return XMLConstants.XMLNS_ATTRIBUTE_NS_URI.equals(namespaceURI); return false; |
boolean | isNamespaceElement(Node node, String namespace) Determines if the given Node is an Element and is in the given String namespace.
if (node == null) { return false; } else if (node.getNodeType() != Node.ELEMENT_NODE) { return false; } else if (namespace != null && !namespace.equals(node.getNamespaceURI())) { return false; } else { return true; ... |
boolean | isNamespaceElement(Node node, String namespace) Determines if the given Node is an Element and is in the given String namespace.
if (node == null) { return false; } else if (node.getNodeType() != Node.ELEMENT_NODE) { return false; } else if (namespace != null && !namespace.equals(node.getNamespaceURI())) { return false; } else { return true; ... |
boolean | isNonDefaultNamespace(Node node) is Non Default Namespace return (isNamespace(node) && !"xmlns".equals(node.getNodeName())); |
boolean | isSameNamespace(Node node, String namespace) is Same Namespace String prefix = getPrefix(node.getNodeName());
return hasNamespace(node, prefix, namespace);
|