List of utility methods to do XML QName
QName | stringToQName(XMLStreamReader reader, String text, String defaultNS) string To Q Name String localPart = text.substring(text.indexOf(':') + 1, text.length()); int i = text.indexOf(':'); String prefix = i < 0 ? null : text.substring(0, i); String namespaceURI = prefix == null ? defaultNS : reader.getNamespaceURI(prefix); return prefix == null ? new QName(namespaceURI, localPart) : new QName(namespaceURI, localPart, prefix); |
String | toJavaName(QName xmlName) Translate an XML name to a Java name. return xmlName.getLocalPart();
|
QName | uniqueQName(QName q) unique Q Name String s = q.getNamespaceURI(); while (s.endsWith("/")) { s = s.substring(0, s.length() - 1); return new QName(s, q.getLocalPart()); |
QName | uriToQName(String uri) uri To Q Name if (uri == null) { throw new IllegalArgumentException("URI is null"); int index = uri.lastIndexOf("#"); if (index != -1) { String ns = uri.substring(0, index); String name = uri.substring(index + 1); return new QName(ns, name); ... |