Hi!
I am kind of new to this stuff and right now I'm trying to count the number of
nodes that fulfils a xPath-expression.
What I want to do i simple "countNodes(const std::string &xPath)".
I should probably do this with Xalan (or?), but can I do it with Xerces?
This is what I do (roughly) before I want to cound the nodes (I do it for other
reasons and that's why I want to continue to use my already created parser):
impl =
DOMImplementationRegistry::getDOMImplementation(XMLString::transcode("LS"));
parser = ((DOMImplementationLS*)
impl)->createDOMBuilder(DOMImplementationLS::MODE_SYNCHRONOUS, 0);
// set some features on parserobject...
doc = parser->parseURI(const_cast<char*>(xml.c_str()));
// use doc to useful stuff
This should give me a DOM-tree right in doc?
So now I want to do doc.countNodes("/root/level1/level2"); // how many nodes is
there that looks like this: <root><level1><level2>?
I should not be impossible to do something like that...=)
Thanks for any suggestions!
//daniel
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]