From: Sami Islam [mailto:[EMAIL PROTECTED]
Sent: Wednesday, May 19, 2004 1:46 PM
To: Xalan User List
Subject: How to use Xpath from Xalan.Hello,
I need some clarification on how to correctly use the XPathEvaluator in Xalan.In the sample programs from Xalan 1.7 the evaluator is first used :
1) to find the context node.
2) to find the list of nodes.
3) finally evaluate the result.My questions:
1) Do I have to get a context node?
e.g. If I want the node at /doc/[EMAIL PROTECTED]'Tom']/@last do I have to first get the context node for "/" and then evaluate the _expression_ "doc/[EMAIL PROTECTED]'Tom']/@last?Isn't there a way I can just obtain the node directly without the 1) step.
e.g. evaluator.selectSingleNode(..., ..., XalanDOMString("/doc/[EMAIL PROTECTED]'tom')/@last").c_str( ), ...); instead of evaluator.selectSingleNode(..., ..., XalanDOMString("/").c_str( ), ...); first.The only thing that is unclear to me is the evaluator.evaluate( ) member function that takes a "context_node" as its second parameter and "XpathString" as its third.
Regards,
Sami
Title: How to use Xpath from Xalan.
do we have the facility to provide context node as a
string?
e.g we say evaluator.evaluate(...,
"/doc/[EMAIL PROTECTED]'tom']/@last", "/doc", ...);
- How to use Xpath from Xalan. Sami Islam
- Re: How to use Xpath from Xalan. Francesc Guim Bernat
- RE: How to use Xpath from Xalan. Erik Rydgren
- Jaspreet Singh
