Search in sources :

Example 6 with Namespace

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());
    }
}
Also used : QName(javax.xml.namespace.QName) Namespace(org.dom4j.Namespace)

Aggregations

Namespace (org.dom4j.Namespace)6 Element (org.dom4j.Element)4 QName (org.dom4j.QName)3 ZimbraNamespace (com.zimbra.common.soap.ZimbraNamespace)1 StringReader (java.io.StringReader)1 KeyStore (java.security.KeyStore)1 X509Certificate (java.security.cert.X509Certificate)1 ArrayList (java.util.ArrayList)1 Iterator (java.util.Iterator)1 LinkedHashSet (java.util.LinkedHashSet)1 List (java.util.List)1 QName (javax.xml.namespace.QName)1 AuthorizationException (org.apereo.portal.AuthorizationException)1 IUserProfile (org.apereo.portal.IUserProfile)1 PortletPreferenceImpl (org.apereo.portal.portlet.dao.jpa.PortletPreferenceImpl)1 IPortletDefinition (org.apereo.portal.portlet.om.IPortletDefinition)1 IPortletEntity (org.apereo.portal.portlet.om.IPortletEntity)1 IPortletPreference (org.apereo.portal.portlet.om.IPortletPreference)1 IPerson (org.apereo.portal.security.IPerson)1 BrokenSecurityContext (org.apereo.portal.security.provider.BrokenSecurityContext)1