|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.saxon.sxpath.AbstractStaticContext net.sf.saxon.xpath.JAXPXPathStaticContext
public class JAXPXPathStaticContext
A JAXPXPathStaticContext provides a context for parsing an XPath expression
in a context other than a stylesheet. In particular, it is used to support
the JAXP 1.3 XPath API. The JAXP API does not actually expose the StaticContext
object directly; rather, the static context (namespaces, variables, and functions)
is manipulated through the XPath object, implemented in Saxon by the XPathEvaluator
Field Summary |
---|
Fields inherited from class net.sf.saxon.sxpath.AbstractStaticContext |
---|
usingDefaultFunctionLibrary |
Constructor Summary | |
---|---|
JAXPXPathStaticContext(Configuration config)
Create a JAXPXPathStaticContext using a specific Configuration. |
Method Summary | |
---|---|
Expression |
bindVariable(StructuredQName qName)
Bind a variable used in an XPath Expression to the XSLVariable element in which it is declared. |
int |
getContainerGranularity()
Get the granularity of the container. |
Set |
getImportedSchemaNamespaces()
Get the set of imported schemas |
NamespaceContext |
getNamespaceContext()
Get the NamespaceContext that was set using setNamespaceContext(javax.xml.namespace.NamespaceContext) |
NamespaceResolver |
getNamespaceResolver()
Get a namespace resolver to resolve the namespaces declared in this static context. |
SlotManager |
getStackFrameMap()
Get the stack frame map containing the slot number allocations for the variables declared in this static context |
String |
getURIForPrefix(String prefix)
Get the URI for a prefix, using the declared namespaces as the context for namespace resolution. |
String |
getURIForPrefix(String prefix,
boolean useDefault)
Get the namespace URI corresponding to a given prefix. |
XPathFunctionResolver |
getXPathFunctionResolver()
|
XPathVariableResolver |
getXPathVariableResolver()
Get the XPathVariableResolver |
void |
importSchema(Source source)
Import a schema. |
boolean |
isImportedSchema(String namespace)
Determine whether a Schema for a given target namespace has been imported. |
Iterator |
iteratePrefixes()
Get an iterator over all the prefixes declared in this namespace context. |
void |
setNamespaceContext(NamespaceContext context)
Supply the NamespaceContext used to resolve namespaces. |
void |
setXPathFunctionResolver(XPathFunctionResolver xPathFunctionResolver)
|
void |
setXPathVariableResolver(XPathVariableResolver resolver)
Set an XPathVariableResolver. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JAXPXPathStaticContext(Configuration config)
config
- the Configuration. For schema-aware XPath expressions, this must be an EnterpriseConfiguration.Method Detail |
---|
public int getContainerGranularity()
public void setNamespaceContext(NamespaceContext context)
public NamespaceContext getNamespaceContext()
setNamespaceContext(javax.xml.namespace.NamespaceContext)
public SlotManager getStackFrameMap()
public void setXPathVariableResolver(XPathVariableResolver resolver)
resolver
- A JAXP 1.3 XPathVariableResolverpublic XPathVariableResolver getXPathVariableResolver()
public void setXPathFunctionResolver(XPathFunctionResolver xPathFunctionResolver)
public XPathFunctionResolver getXPathFunctionResolver()
public String getURIForPrefix(String prefix) throws XPathException
getURIForPrefix
in interface StaticContext
prefix
- The prefix
XPathException
- if the prefix is not declaredpublic NamespaceResolver getNamespaceResolver()
StaticContext
getNamespaceResolver
in interface StaticContext
public String getURIForPrefix(String prefix, boolean useDefault)
setNamespaceContext(javax.xml.namespace.NamespaceContext)
.
getURIForPrefix
in interface NamespaceResolver
prefix
- the namespace prefixuseDefault
- true if the default namespace for elements and types is to be used when the
prefix is ""
public Iterator iteratePrefixes()
setNamespaceContext(javax.xml.namespace.NamespaceContext)
is an
instance of Saxon's NamespaceResolver
class. In other cases the method throws an
UnsupportedOperationException
iteratePrefixes
in interface NamespaceResolver
UnsupportedOperationException
- if the NamespaceContext object is not a NamespaceResolver.public final Expression bindVariable(StructuredQName qName) throws XPathException
bindVariable
in interface StaticContext
qName
-
VariableReference
, suitably initialized to refer to the corresponding variable declaration,
but in general it can be any expression.
XPathException
- if no VariableResolver has been supplied.public void importSchema(Source source) throws SchemaException
source
- A Source object identifying the schema document to be loaded
SchemaException
- if the schema contained in this document is invalid
UnsupportedOperationException
- if the configuration is not schema-awarepublic boolean isImportedSchema(String namespace)
isImportedSchema
in interface StaticContext
namespace
- the target namespace in question
public Set getImportedSchemaNamespaces()
getImportedSchemaNamespaces
in interface StaticContext
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |