|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.sf.saxon.instruct.NamespaceContext
An object representing a list of Namespaces. Used when the namespace controller in the stylesheet needs to be kept for use at run-time. The list of namespaces is maintained in the form of numeric prefix/uri codes, which are only meaningful in the controller of a name pool; however, in order to save space, the NamespaceContext object does not keep a reference to the namepool, it requires this to be supplied by the caller.
Constructor Summary | |
NamespaceContext(int[] nscodes)
Create a NamespaceContext object |
Method Summary | |
int |
getFingerprint(java.lang.String qname,
boolean useDefault,
NamePool pool)
Use this NamespaceContext to resolve a lexical QName |
int[] |
getNamespaceCodes()
Get the list of in-scope namespaces held in this NamespaceContext |
java.lang.String |
getURIForPrefix(java.lang.String prefix,
boolean useDefault,
NamePool pool)
Get the namespace URI corresponding to a given prefix. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public NamespaceContext(int[] nscodes)
nscodes
- an array of namespace codes. Each namespace code is an integer
in which the first 16 bits represent the prefix (zero if it's the default namespace)
and the next 16 bits represent the uri. These are codes held in the NamePoolMethod Detail |
public int[] getNamespaceCodes()
public java.lang.String getURIForPrefix(java.lang.String prefix, boolean useDefault, NamePool pool)
getURIForPrefix
in interface NamespaceResolver
prefix
- the namespace prefixuseDefault
- true if the default namespace is to be used when the
prefix is ""pool
- the namepool to be used for looking up the codes. This must be the
run-time namepool.
public int getFingerprint(java.lang.String qname, boolean useDefault, NamePool pool) throws XPathException
getFingerprint
in interface NamespaceResolver
qname
- the lexical QName; this must have already been lexically validateduseDefault
- true if the default namespace is to be used to resolve an unprefixed QNamepool
- the NamePool to be used
XPathException.Dynamic
- if the string is not a valid lexical QName or
if the namespace prefix has not been declared
XPathException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |