/** * Returns the namespace hierarchy. * * @param nsInherit copy-namespaces inherit * @return namespaces [LW][LK] Namespaces: this isn't enough */ public final Atts nsScope(final boolean nsInherit) { final Atts ns = new Atts(); ANode n = this; do { final Atts nns = n.ns(); if (!nsInherit) return nns; if (nns != null) { for (int a = nns.size - 1; a >= 0; a--) { final byte[] key = nns.key[a]; if (!ns.contains(key)) ns.add(key, nns.val[a]); } } n = n.parent(); } while (n != null && n.type == NodeType.ELM); return ns; }