Java XML QName getKey(QName name)

Here you can find the source of getKey(QName name)

Description

get Key

License

Open Source License

Declaration

public static String getKey(QName name) 

Method Source Code


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

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

public class Main {
    public static String getKey(QName name) {
        if (name == null) {
            return null;
        }/*ww  w. java  2 s. co m*/
        final StringBuilder sb = new StringBuilder();
        final String namespaceURI = name.getNamespaceURI();
        if (!namespaceURI.equals(XMLConstants.NULL_NS_URI)) {
            sb.append("{").append(namespaceURI).append("}");
        }
        final String prefix = name.getPrefix();
        if (!XMLConstants.DEFAULT_NS_PREFIX.equals(prefix)) {
            sb.append(prefix).append(":");
        }
        final String localPart = name.getLocalPart();
        sb.append(localPart);
        return sb.toString();

    }
}

Related

  1. formatQName(QName qname)
  2. getClassForDatatype(QName qname)
  3. getClassName(QName qname)
  4. getDirectChildElementsOnly(QName qName, Element element)
  5. getFirstChild(SOAPElement body, QName elementName)
  6. getLocalAddress(QName port)
  7. getMatchingExtensionProvider(Map extensionMap, String namespaceURI, String prefix, String localName)
  8. getMediaTypeFromAttributes(Map attributes)
  9. getNodeQName(Node el)