Java XML QName hasQName(Node node, QName qname)

Here you can find the source of hasQName(Node node, QName qname)

Description

Determines if a node has a particular qualified name.

License

Open Source License

Parameter

Parameter Description
node the node
qname the qualified name

Return

true if the node has the given qualified name, false if not

Declaration

public static boolean hasQName(Node node, QName qname) 

Method Source Code

//package com.java2s;

import javax.xml.namespace.QName;

import org.w3c.dom.Node;

public class Main {
    /**//from  ww w . j a v  a2 s.co m
     * Determines if a node has a particular qualified name.
     * @param node the node
     * @param qname the qualified name
     * @return true if the node has the given qualified name, false if not
     */
    public static boolean hasQName(Node node, QName qname) {
        return qname.getNamespaceURI().equals(node.getNamespaceURI())
                && qname.getLocalPart().equals(node.getLocalName());
    }
}

Related

  1. getXSTypeAsString(QName qname)
  2. hasAnnotatedQname(Object obj)
  3. hasChildElement(QName qName, Element element)
  4. hasGmlNamespace(QName qname)
  5. hasQName(final Node e, final QName name)
  6. isElementName(Element element, QName name)
  7. isEndElement(final XMLEvent event, final QName name)
  8. isEventStartOrEndElementWithMatchingName(XMLEvent event, QName elementName)
  9. isJAXBElement(Class declaredType, QName name, Class scope, Object value)