List of utility methods to do XML QName
void | addInfo(final QName nm, final Integer kind, final Class cl) add Info compNames.put(cl, nm); compKinds.put(nm, kind); |
void | addNamespace(Element element, QName qName) add Namespace element.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:" + qName.getLocalPart(), qName.getNamespaceURI()); |
void | addTypeQname(QName elemntNameSpace, List add Type Qname if (elemntNameSpace != null) { propertyQnameValueList.add( new QName(elemntNameSpace.getNamespaceURI(), propDesc.getName(), elemntNameSpace.getPrefix())); } else { if (processingDocLitBare) { propertyQnameValueList.add(new QName(propDesc.getName())); } else { propertyQnameValueList ... |
boolean | compareQName(QName qname, Node node) compare Q Name return (qname.getNamespaceURI().equals(node.getNamespaceURI())
&& qname.getLocalPart().equals(node.getLocalName()));
|
boolean | compareRelation(QName a, QName b) compare Relation if (a == null && b == null) { return true; if (a == null || b == null) { return false; return a.equals(b); |
boolean | compareWithOutNamespace(QName value, QName tagName) Compare two XML tags if (value != null) { return (value.getLocalPart().equals(tagName.getLocalPart())); return false; |
String | concatAttributes(List Concatenates the value of the attribute named attrName for all elements in startElements .
String announcements = ""; for (int i = 0; i < startElements.size(); i++) { StartElement se = startElements.get(i); for (Iterator<?> atIt = se.getAttributes(); atIt.hasNext();) { Attribute at = (Attribute) atIt.next(); if (attrName.equals(at.getName())) { announcements += at.getValue() + " "; break; ... |
boolean | contains(final QName[] qnames, final QName qname, final String defaultNamespace) contains for (QName a : qnames) { if (equal(a, qname, defaultNamespace)) { return true; return false; |
SortedMap | convertQNameListToNamespaceToLocalNameList( List convert Q Name List To Namespace To Local Name List SortedMap<String, SortedSet<String>> res = new TreeMap<>(); for (QName qname : list) { SortedSet<String> localNameSet = res.computeIfAbsent(qname.getNamespaceURI(), k -> new TreeSet<>()); localNameSet.add(qname.getLocalPart()); return res; |
String | convertQNameToFullname(QName qn) convert Q Name To Fullname String returnValue = ""; String nsu = qn.getNamespaceURI(); if (nsu != null && nsu.length() != 0) { returnValue = "{" + nsu + "}"; returnValue += qn.getLocalPart(); return returnValue; |