|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.fujitsu.xml.omquery.VariableMgr
com.fujitsu.xml.omquery.XPathContext
public class XPathContext
A class which which represents XPath evaluation context against which expressions are to be evaluated.
InputSource input = new InputSource(createURL("sample.xml"));
JAXP_ProcessorImpl xmlproc = new JAXP_ProcessorImpl();
Document doc = xmlproc.load(input);
DomQueryMgr query_mgr = new DomQueryMgr(doc);
NamespacePrefixMap nspm = query_mgr.getEmptyNamespacePrefixMap();
nspm = nspm.bind("foo", "http://www.foo.co.jp/");
XPathContext ctx = new XPathContext(doc, nspm, 10, 100);
ctx.addNumberVariable("a", 1.0);
String str = query_mgr.getStringByXPath("(A/B/C)[2]", ctx);
| Nested Class Summary | |
|---|---|
protected class |
XPathContext.MyAddVariableSet
|
| Field Summary | |
|---|---|
protected com.jclark.xsl.om.NameTable |
nametbl
|
protected MyVariableSet |
varset
|
| Constructor Summary | |
|---|---|
XPathContext(DomQueryMgr query_mgr)
|
|
XPathContext(DomQueryMgr query_mgr,
org.w3c.dom.Node dom_node,
com.jclark.xsl.om.NamespacePrefixMap nspm)
|
|
XPathContext(DomQueryMgr query_mgr,
org.w3c.dom.Node dom_node,
com.jclark.xsl.om.NamespacePrefixMap nspm,
int position,
int size)
|
|
| Method Summary | |
|---|---|
void |
addBooleanVariable(java.lang.String varname,
boolean value)
Add a Boolean variable to the list of managed variables. |
void |
addNodeArrayVariable(java.lang.String varname,
org.w3c.dom.Node[] dom_nodes,
int start,
int len)
Add a variable of type DOM Node[] to the list of managed variables. |
void |
addNumberVariable(java.lang.String varname,
double value)
Add a Number variable to the list of managed variables. |
void |
addSingleNodeVariable(java.lang.String varname,
org.w3c.dom.Node dom_node)
Add a variable of type DOM Node to the list of managed variables. |
void |
addStringVariable(java.lang.String varname,
java.lang.String value)
Add a String variable to the list of managed variables. |
void |
addVariable(java.lang.String varname,
java.lang.String expr)
Add a variable to the list of managed variables. |
(package private) void |
eval(com.jclark.xsl.om.Node node,
com.jclark.xsl.expr.ExprContext context)
|
org.w3c.dom.Node |
getDomNode()
Get context node. |
com.jclark.xsl.om.NamespacePrefixMap |
getNamespacePrefixMap()
Get the set of namespace bindings. |
int |
getPosition()
Get context position. |
int |
getSize()
Get context size. |
(package private) com.jclark.xsl.expr.VariableSet |
getVariableSet()
|
(package private) com.jclark.xsl.expr.Variant |
getVariableValue(com.jclark.xsl.om.Name name)
|
(package private) void |
reset()
Make the list of managed variables empty. |
void |
resetVariableSet()
Make the list of managed variables empty. |
void |
setDomNode(org.w3c.dom.Node dom_node)
Set context node. |
void |
setNamespacePrefixMap(com.jclark.xsl.om.NamespacePrefixMap nspm)
Set the set of namespace bindings. |
void |
setPosition(int position)
Set context position. |
void |
setSize(int size)
Set context size. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final com.jclark.xsl.om.NameTable nametbl
protected MyVariableSet varset
| Constructor Detail |
|---|
XPathContext(DomQueryMgr query_mgr)
XPathContext(DomQueryMgr query_mgr,
org.w3c.dom.Node dom_node,
com.jclark.xsl.om.NamespacePrefixMap nspm)
XPathContext(DomQueryMgr query_mgr,
org.w3c.dom.Node dom_node,
com.jclark.xsl.om.NamespacePrefixMap nspm,
int position,
int size)
| Method Detail |
|---|
public void setDomNode(org.w3c.dom.Node dom_node)
public void setNamespacePrefixMap(com.jclark.xsl.om.NamespacePrefixMap nspm)
public void setPosition(int position)
public void setSize(int size)
public org.w3c.dom.Node getDomNode()
public com.jclark.xsl.om.NamespacePrefixMap getNamespacePrefixMap()
public int getPosition()
public int getSize()
public void addVariable(java.lang.String varname,
java.lang.String expr)
throws com.jclark.xsl.om.XSLException
addVariable in class VariableMgrexpr - XPath expression which is to be evaluated to yield the value for
the variable.
com.jclark.xsl.om.XSLException
public void addStringVariable(java.lang.String varname,
java.lang.String value)
throws com.jclark.xsl.om.XSLException
addStringVariable in class VariableMgrvalue - a String which is bound as the value of the variable.
com.jclark.xsl.om.XSLException
public void addNumberVariable(java.lang.String varname,
double value)
throws com.jclark.xsl.om.XSLException
addNumberVariable in class VariableMgrvalue - a Number which is bound as the value of the variable.
com.jclark.xsl.om.XSLException
public void addBooleanVariable(java.lang.String varname,
boolean value)
throws com.jclark.xsl.om.XSLException
addBooleanVariable in class VariableMgrvalue - a Boolean which is bound as the value of the variable.
com.jclark.xsl.om.XSLException
public void addSingleNodeVariable(java.lang.String varname,
org.w3c.dom.Node dom_node)
throws com.jclark.xsl.om.XSLException
addSingleNodeVariable in class VariableMgrvalue - a DOM Node which is bound as the value of the variable.
com.jclark.xsl.om.XSLException
public void addNodeArrayVariable(java.lang.String varname,
org.w3c.dom.Node[] dom_nodes,
int start,
int len)
throws com.jclark.xsl.om.XSLException
addNodeArrayVariable in class VariableMgrvalue - Array of DOM Node which is bound as the value of the variable.
com.jclark.xsl.om.XSLExceptionpublic void resetVariableSet()
void reset()
VariableMgr
reset in class VariableMgr
void eval(com.jclark.xsl.om.Node node,
com.jclark.xsl.expr.ExprContext context)
throws com.jclark.xsl.om.XSLException
eval in class VariableMgrcom.jclark.xsl.om.XSLExceptioncom.jclark.xsl.expr.VariableSet getVariableSet()
getVariableSet in class VariableMgr
com.jclark.xsl.expr.Variant getVariableValue(com.jclark.xsl.om.Name name)
throws com.jclark.xsl.om.XSLException
getVariableValue in class VariableMgrcom.jclark.xsl.om.XSLException
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||