Hello,
I'm trying to use de XPath implementation of Xalan in C++
and I d'ont undestand the role of XalanSourceTreeDOMSupport with XPath 
(and in general)
So first where to find revelant doc on the use of the class of the 
Xalan-C API (the use and the role not the C++ definition!)

My problem is:
XalanSourceTreeDOMSupport and XalanSourceTreeParserLiaison are used in 
the Xalan samples code off SimpleXPathAPI to parse a file (OK, no problem..)
but the XalanSourceTreeDOMSupport is also used to implement the 
"contextNode" with the XPathEvaluator. selectSingleNode() and  
XPathEvaluator.evaluate methods...
to get the value correspondig to the XPath function

I'like to have a class xTree containing (as member fucntion) a XML 
tree/doc (or a DOM tree if you want)
I've tried with a XalanDocument* as a member of this class xTree
the only constructor for the moment call my parse(file) method that 
seems to work and
Now I'd like to have a XTree.getValueByXPath(char *XPath) and/or 
XTree.getValueByXPath(char* context, char *XPath)
but I've parsed before so no DOM support, Parser Liaison or this kind of 
object and even if I tried to give some it's seems to have a problem 
(I've tried I get a seg. fault around theContextNode =
    theEvaluator.selectSingleNode(theDOMSupport...))
but I don't want to reparse the file to each call of the getValue method!

So my questions are:
- should I insert as member of my class others objects (like a 
XalanSourceTreeDOMSupport) ?
- Was it a good idea to choose a XalanDocument/XalanNode/DOMNode ... in 
the class something else could be better and what?
- There are others solutions to evaluate an Xpath without DOMSupport or 
how to have an appropriate DOMSupport.. and what is this DOMSUpport

Thank you
Vincent
PS: I can send my code if the problem is not clear...


Reply via email to