use of org.dom4j.Namespace in project zm-mailbox by Zimbra.
the class JaxbUtil method removeNamespacePrefixes.
/**
* Use namespace inheritance in preference to prefixes
* @param elem
* @param defaultNs
*/
private static void removeNamespacePrefixes(org.dom4j.Element elem) {
Namespace elemNs = elem.getNamespace();
if (elemNs != null) {
if (!Strings.isNullOrEmpty(elemNs.getPrefix())) {
Namespace newNs = Namespace.get(elemNs.getURI());
org.dom4j.QName newQName = new org.dom4j.QName(elem.getName(), newNs);
elem.setQName(newQName);
}
}
Iterator<?> elemIter = elem.elementIterator();
while (elemIter.hasNext()) {
JaxbUtil.removeNamespacePrefixes((org.dom4j.Element) elemIter.next());
}
}
Aggregations