示例#1
0
 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();
 }
示例#2
0
 /** Return an enumeration of all prefixes currently declared. */
 public Iterator<String> getAllPrefixes() {
   return currentContext.getPrefixes();
 }