01: package net.sf.saxon.om;
02:
03: import java.util.Iterator;
04:
05: /**
06: * Abstract class that supports lookup of a lexical QName to get the expanded QName.
07: * This extends the JAXP NamespaceContext interface with some Saxon-specific methods,
08: * which must be supplied in a concrete implementation.
09: */
10:
11: public interface NamespaceResolver {
12:
13: /**
14: * Get the namespace URI corresponding to a given prefix. Return null
15: * if the prefix is not in scope.
16: * @param prefix the namespace prefix. May be the zero-length string, indicating
17: * that there is no prefix. This indicates either the default namespace or the
18: * null namespace, depending on the value of useDefault.
19: * @param useDefault true if the default namespace is to be used when the
20: * prefix is "". If false, the method returns "" when the prefix is "".
21: * @return the uri for the namespace, or null if the prefix is not in scope.
22: * The "null namespace" is represented by the pseudo-URI "".
23: */
24:
25: public abstract String getURIForPrefix(String prefix,
26: boolean useDefault);
27:
28: /**
29: * Get an iterator over all the prefixes declared in this namespace context. This will include
30: * the default namespace (prefix="") and the XML namespace where appropriate
31: */
32:
33: public abstract Iterator iteratePrefixes();
34:
35: }
36:
37: //
38: // The contents of this file are subject to the Mozilla Public License Version 1.0 (the "License");
39: // you may not use this file except in compliance with the License. You may obtain a copy of the
40: // License at http://www.mozilla.org/MPL/
41: //
42: // Software distributed under the License is distributed on an "AS IS" basis,
43: // WITHOUT WARRANTY OF ANY KIND, either express or implied.
44: // See the License for the specific language governing rights and limitations under the License.
45: //
46: // The Original Code is: all this file.
47: //
48: // The Initial Developer of the Original Code is Michael H. Kay
49: //
50: // Portions created by (your name) are Copyright (C) (your legal entity). All Rights Reserved.
51: //
52: // Contributor(s): none
53: //
|