List of utility methods to do XML QName
String | getNoNamespacePath(Stack get No Namespace Path StringBuilder ret = new StringBuilder(); for (QName q : stack) { if (q == null) throw new IllegalStateException("q is null"); ret.append("/"); ret.append(q.getLocalPart()); return ret.toString(); ... |
QName | getNSName(Element e, String qname) get NS Name if (qname == null) { return null; int i = qname.indexOf(':'); if (i > 0) { String name = qname.substring(i + 1); String prefix = qname.substring(0, i); return new QName(getNamespaceURI(e, prefix), name); ... |
Element | getOrCreateAsFirstElement(Element parentElement, QName elementQName) get Or Create As First Element Element element = getChildElement(parentElement, elementQName); if (element != null) { return element; Document doc = parentElement.getOwnerDocument(); element = doc.createElementNS(elementQName.getNamespaceURI(), elementQName.getLocalPart()); parentElement.insertBefore(element, getFirstChildElement(parentElement)); return element; ... |
QName | getPartQName(String opName, String suffix, String partName) part names are not unique across messages. return new QName(opName + suffix, partName); |
Object | getPort(Service service, Class seiClass, QName port) Convenient method to create a sei using service, sei class and port qname. return service.getPort(port, seiClass);
|
String | getPrefix(QName qName) Returns the prefix of the given QName .
return qNameHasPrefix ? qName.getPrefix() : ""; |
String | getQualifiedName(QName qName) Return the qualified name, that is to say the prefix -if any- with the local name. if (!XMLConstants.NULL_NS_URI.equals(qName.getNamespaceURI()) && !XMLConstants.DEFAULT_NS_PREFIX.equals(qName.getPrefix())) { return qName.getPrefix() + ":" + qName.getLocalPart(); } else { return qName.getLocalPart(); |
String | getServiceCode(SOAPMessage soap, QName requestElementQName) get Service Code for (SOAPElement eachHeaderElement : getChildElements(soap.getSOAPHeader())) { QName headerElementQName = eachHeaderElement.getElementQName(); if (!"service".equals(headerElementQName.getLocalPart())) { continue; for (SOAPElement eachServicePart : getChildElements(eachHeaderElement)) { QName headerPartQName = eachServicePart.getElementQName(); if (headerPartQName.getLocalPart().equals("serviceCode")) { ... |
String | getString(QName qName) Get the full string of qname if (qName == null) throw new NullPointerException("argument is null"); StringBuffer sb = new StringBuffer(); sb.append("NamespaceUri:" + qName.getNamespaceURI() + " "); sb.append("LocalPart:" + qName.getLocalPart() + " "); sb.append("Prefix:" + qName.getPrefix()); return sb.toString(); |
String | getStringForQName(QName qname, Element e) Return a string for a particular QName, mapping a new prefix if necessary. String uri = qname.getNamespaceURI(); String prefix = getPrefix(uri, e); if (prefix == null) { int i = 1; prefix = "ns" + i; while (getNamespace(prefix, e) != null) { i++; prefix = "ns" + i; ... |