1 package net.sf.saxon.functions; 2 import net.sf.saxon.expr.XPathContext; 3 import net.sf.saxon.om.*; 4 import net.sf.saxon.trans.XPathException; 5 import net.sf.saxon.value.StringValue; 6 7 import java.util.ArrayList ; 8 import java.util.Iterator ; 9 import java.util.List ; 10 11 14 15 public class InScopePrefixes extends SystemFunction { 16 17 20 21 public SequenceIterator iterate(XPathContext context) throws XPathException { 22 NodeInfo element = (NodeInfo)argument[0].evaluateItem(context); 23 NamespaceResolver resolver = new InscopeNamespaceResolver(element); 24 Iterator iter = resolver.iteratePrefixes(); 25 List list = new ArrayList (10); 26 while (iter.hasNext()) { 27 list.add(StringValue.makeStringValue((String )iter.next())); 28 } 29 return new ListIterator(list); 30 31 } 32 33 } 34 35 | Popular Tags |