/** * Add mapping from namespace URI to prefix. In the case where multiple prefixes are used with a * single URI, this will preserve the last non-empty prefix for that URI. * * @param ns namespace definition * @param dfltns flag for default namespace used in binding * @param nsmap map from namespace URIs to prefixes * @return flag for default namespace used in binding */ private boolean mapNamespace(NamespaceElement ns, boolean dfltns, Map nsmap) { String prefix = ns.getPrefix(); if (prefix == null) { prefix = ""; } String prior = (String)nsmap.get(ns.getUri()); if (prior != null) { if (prefix.length() == 0) { return dfltns; } else if (prior.length() == 0) { dfltns = false; } } nsmap.put(ns.getUri(), prefix); return dfltns || prefix.length() == 0; }
/** * Add mapping from namespace URI to prefix. In the case where multiple prefixes are used with a * single URI, this will preserve the last non-empty prefix for that URI. * * @param ns namespace definition * @param dfltns flag for default namespace used in binding * @param nsmap map from namespace URIs to prefixes * @return flag for default namespace used in binding */ private boolean mapNamespace(NamespaceElement ns, boolean dfltns, Map nsmap) { String prefix = ns.getPrefix(); if (prefix == null) { prefix = ""; } String prior = (String)nsmap.get(ns.getUri()); if (prior != null) { if (prefix.length() == 0) { return dfltns; } else if (prior.length() == 0) { dfltns = false; } } nsmap.put(ns.getUri(), prefix); return dfltns || prefix.length() == 0; }
if (((NamespaceElement)child).getPrefix() == null) { return true;