List of utility methods to do XML Node Namespace
String | getNamespaceURI(Node node) get Namespace URI return node.getNamespaceURI();
|
String | getNamespaceUri(Node node) Get the namespace URI of a given node. String namespace = node.getNamespaceURI();
return (namespace != null) ? namespace : XMLConstants.NULL_NS_URI;
|
String | getNamespaceURI(Node node) get Namespace URI return node.getNamespaceURI();
|
String | getNameSpaceUri(Node node, String content, String namespaceURI) get Name Space Uri if (namespaceURI == null) { namespaceURI = node.lookupNamespaceURI(content.substring(0, content.indexOf(":"))); return namespaceURI; |
String | getNamespaceURI(Node node, String searchPrefix) get Namespace URI return node.lookupNamespaceURI(searchPrefix);
|
String | getNodeName(Node node, NamespaceContext namespaceContext) Returns the node name using the prefixes defined in the given namespace context rather than the prefixes used in the parsed XML. if (node == null) return null; String name = node.getNodeName(); if (name.startsWith("xmlns:")) { String uri = node.getNodeValue(); if (uri != null && namespaceContext != null) { String prefix = namespaceContext.getPrefix(uri); if (prefix != null) { ... |
String | getNodeString(Node node, NamespaceContext context) Builds an XPath string referencing the given node relative to it's parent. if (node == null) { return null; String nodeName = node.getLocalName(); if (nodeName == null) nodeName = node.getNodeName(); if (node.getNamespaceURI() != null) { String prefix = context.getPrefix(node.getNamespaceURI()); ... |
boolean | hasDITANamespace(Node node) has DITA Namespace String uri = node.getNamespaceURI();
return (uri == null || DITAC_NS_URI.equals(uri));
|
boolean | hasNamespace(Node node, String prefix, String namespace) has Namespace if (namespace == null) { return true; String attrName; if (prefix != null && prefix.length() > 0) { attrName = "xmlns:" + prefix; } else { attrName = "xmlns"; ... |
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); |