Java XML Node Namespace isInNamespace(Node node, String namespace)

Here you can find the source of isInNamespace(Node node, String namespace)

Description

Determines if the given Node belongs to the namespace with the given String name.

License

Open Source License

Parameter

Parameter Description
node the <code>Node</code> to check
namespace the <code>String</code> namespace

Return

true if the Node namespace matches, else false

Declaration

public static boolean isInNamespace(Node node, String namespace) 

Method Source Code

//package com.java2s;

import org.w3c.dom.Node;

public class Main {
    /**/*from  ww w .  j  a  va  2  s. com*/
     * Determines if the given <code>Node</code> belongs to the namespace with the given <code>String</code> name.
     * 
     * @param node the <code>Node</code> to check
     * @param namespace the <code>String</code> namespace
     * @return true if the <code>Node</code> namespace matches, else false
     */
    public static boolean isInNamespace(Node node, String namespace) {
        return namespace.equals(node.getNamespaceURI());
    }
}

Related

  1. hasNamespace(Node node, String prefix, String namespace)
  2. hasNamespaceURI(@Nullable final Node aNode, @Nullable final String sNamespaceURI)
  3. hasNamespaceURI(@Nullable final Node aNode, @Nullable final String sNamespaceURI)
  4. isAppropriateElement(Node iNode, String iNodeName, String iNamespace)
  5. isAppropriateElement(Node iNode, String iNodeName, String iNamespace)
  6. isInNamespace(Node node, String namespace)
  7. isNamespace(Node node)
  8. isNamespaceElement(Node node, String namespace)
  9. isNamespaceElement(Node node, String namespace)