Java Utililty Methods XML QName Convert

List of utility methods to do XML QName Convert

Description

The list of methods to do XML QName Convert are organized into topic(s).

Method

QNametoPid(final QName processType, final long version)
to Pid
return new QName(processType.getNamespaceURI(), processType.getLocalPart() + "-" + version);
StringtoQualifiedName(final QName qname)
Return a qualified representation of the qname.
return toQualifiedName(qname.getPrefix(), qname.getLocalPart());
StringtoQualifiedName(QName qName)
Convert a QName to a qualified name, as used by DOM and SAX.
String prefix = getPrefix(qName);
if (!StringUtils.hasLength(prefix)) {
    return qName.getLocalPart();
} else {
    return prefix + ":" + qName.getLocalPart();
StringtoString(final QName qname)
to String
final String prefix = qname.getPrefix();
final String name = qname.getLocalPart();
if (prefix == null || prefix.length() == 0)
    return name;
return prefix + ':' + name;
StringtoString(QName qName)
Returns a string representation that includes the prefix (if present).
if (qName.getPrefix().equals(DEFAULT_NS_PREFIX)) {
    return qName.toString();
return qName.getPrefix() + ":" + qName.toString();
URItoURI(QName name)
to URI
return URI.create(name.getNamespaceURI() + name.getLocalPart());