public Iterator<String> getPrefixes(String nsuri) { if (nsuri == null) { throw new IllegalArgumentException(); } Iterator<String> i = currentContext.getPrefixes(); if (!i.hasNext()) { return EmptyIterator.<String>emptyIterator(); } final List<String> list = new LinkedList<String>(); do { String prefix = i.next(); if (nsuri.equals(getNamespaceURI(prefix))) { list.add(prefix); } } while (i.hasNext()); return list.iterator(); }
/** Return an enumeration of all prefixes currently declared. */ public Iterator<String> getAllPrefixes() { return currentContext.getPrefixes(); }