Java XML QName getQualifiedName(QName qName)

Here you can find the source of getQualifiedName(QName qName)

Description

Return the qualified name, that is to say the prefix -if any- with the local name.

License

Open Source License

Parameter

Parameter Description
qName The QName.

Return

A string that looks like "prefix:localName" or " NCName".

Declaration

public static String getQualifiedName(QName qName) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import javax.xml.XMLConstants;
import javax.xml.namespace.QName;

public class Main {
    /**/*from w w w .  j ava2  s .  c o m*/
     * Return the qualified name, that is to say the prefix -if any- with the
     * local name.
     *
     * @param qName
     *            The QName.
     * @return A string that looks like "<tt>prefix:localName</tt>" or "
     *         <tt>NCName</tt>".
     */
    public static String getQualifiedName(QName qName) {
        if (!XMLConstants.NULL_NS_URI.equals(qName.getNamespaceURI())
                && !XMLConstants.DEFAULT_NS_PREFIX.equals(qName.getPrefix())) {
            return qName.getPrefix() + ":" + qName.getLocalPart();
        } else {
            return qName.getLocalPart();
        }
    }
}

Related

  1. getNSName(Element e, String qname)
  2. getOrCreateAsFirstElement(Element parentElement, QName elementQName)
  3. getPartQName(String opName, String suffix, String partName)
  4. getPort(Service service, Class seiClass, QName port)
  5. getPrefix(QName qName)
  6. getServiceCode(SOAPMessage soap, QName requestElementQName)
  7. getString(QName qName)
  8. getStringForQName(QName qname, Element e)
  9. getThreddsCatalogAttributeQName(String localName)