|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.saxon.xpath.StandaloneContext
public class StandaloneContext
A StandaloneContext provides a context for parsing an expression or pattern appearing in a context other than a stylesheet.
Constructor Summary | |
---|---|
StandaloneContext()
Create a StandaloneContext using the default Configuration and NamePool |
|
StandaloneContext(Configuration config)
Create a StandaloneContext using a specific NamePool |
|
StandaloneContext(NodeInfo node)
Create a StandaloneContext using a specific Node. |
Method Summary | |
---|---|
Expression |
bindFunction(String qname,
Expression[] arguments)
Identify a (namespace-prefixed) function appearing in the expression |
VariableDeclaration |
bindVariable(int fingerprint)
Bind a variable used in an XPath Expression to the XSLVariable element in which it is declared. |
void |
clearAllNamespaces()
Clear all the declared namespaces, including the standard ones (xml, xslt, saxon). |
void |
clearNamespaces()
Clear all the declared namespaces, except for the standard ones (xml, xslt, saxon, xdt) |
void |
declareCollation(String name,
Comparator comparator,
boolean isDefault)
Declare a named collation |
void |
declareNamespace(String prefix,
String uri)
Declare a namespace whose prefix can be used in expressions |
Variable |
declareVariable(String qname,
Object initialValue)
Declare a variable. |
String |
getBaseURI()
Get the Base URI of the stylesheet element, for resolving any relative URI's used in the expression. |
Comparator |
getCollation(String name)
Get a named collation. |
Configuration |
getConfiguration()
Get the system configuration |
String |
getDefaultCollationName()
Get the name of the default collation. |
short |
getDefaultElementNamespace()
Get the default XPath namespace, as a namespace code that can be looked up in the NamePool |
int |
getLineNumber()
Get the line number of the expression within that container. |
NamePool |
getNamePool()
Get the NamePool used for compiling expressions |
protected int |
getNumberOfVariables()
Determine the number of variables that have been declared |
String |
getSystemId()
Get the system ID of the container of the expression. |
String |
getURIForPrefix(String prefix)
Get the URI for a prefix, using the declared namespaces as the context for namespace resolution. |
boolean |
isImportedSchema(String namespace)
Determine whether a Schema for a given target namespace has been imported |
boolean |
isInBackwardsCompatibleMode()
Determine whether Backwards Compatible Mode is used |
void |
issueWarning(String s)
Issue a compile-time warning. |
void |
setNamespaces(NodeInfo node)
Set all the declared namespaces to be the namespaces that are in-scope for a given node. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StandaloneContext()
public StandaloneContext(Configuration config)
public StandaloneContext(NodeInfo node)
Method Detail |
---|
public Configuration getConfiguration()
getConfiguration
in interface StaticContext
public void declareNamespace(String prefix, String uri)
prefix
- The namespace prefix. Must not be null. Must not be the empty string
("") - unqualified names in an XPath expression always refer to the null namespace.uri
- The namespace URI. Must not be null.public void clearNamespaces()
public void clearAllNamespaces()
public void setNamespaces(NodeInfo node)
node
- The node whose in-scope namespaces are to be used as the context namespaces.
Note that this will have no effect unless this node is an element.public void declareCollation(String name, Comparator comparator, boolean isDefault)
name
- The name of the collation (technically, a URI)comparator
- The Java Comparator used to implement the collating sequenceisDefault
- True if this is to be used as the default collationpublic Variable declareVariable(String qname, Object initialValue) throws XPathException
XPathException
public NamePool getNamePool()
getNamePool
in interface StaticContext
public void issueWarning(String s)
issueWarning
in interface StaticContext
public String getSystemId()
getSystemId
in interface StaticContext
public String getBaseURI()
getBaseURI
in interface StaticContext
public int getLineNumber()
getLineNumber
in interface StaticContext
public String getURIForPrefix(String prefix) throws XPathException
getURIForPrefix
in interface StaticContext
prefix
- The prefix
XPathException
- if the prefix is not declaredpublic VariableDeclaration bindVariable(int fingerprint) throws XPathException
bindVariable
in interface StaticContext
XPathException
protected int getNumberOfVariables()
public Expression bindFunction(String qname, Expression[] arguments) throws XPathException
bindFunction
in interface StaticContext
XPathException
- if the function is not in scope (note, this doesn't
happen in XSLT, where a reference to an unknown function is a dynamic error).public Comparator getCollation(String name)
getCollation
in interface StaticContext
name
- The name of the required collation. Supply null to get the default collation.
public String getDefaultCollationName()
getDefaultCollationName
in interface StaticContext
public short getDefaultElementNamespace()
getDefaultElementNamespace
in interface StaticContext
public boolean isInBackwardsCompatibleMode()
isInBackwardsCompatibleMode
in interface StaticContext
public boolean isImportedSchema(String namespace)
StaticContext
isImportedSchema
in interface StaticContext
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |