Ifat,
Please try to limit the size of your post to something more reasonable.
This is quite a bit of code, and a smaller example is much easer to
understand.
> void myDom::removeNode(string xpath){
> cout <<"-------------removeNode start " <<endl;
> try{
> XalanNode * xpathNode=this->getNode(_evaluatorI,xpath);
> cout << "parent node type=" <<
> xpathNode->getParentNode()->getNodeType()<< endl;
> cout << "parent node name=" <<
> xpathNode->getParentNode()->getNodeName()<< endl;
> (xpathNode->getParentNode())->removeChild(xpathNode);
> cout << "remove child finished" <<endl;
> cout <<"-------------removeNode finished " <<endl;
> }
> catch (const XalanDOMException & e) {
> cout << "XalanDomExeption was thrown code=" << e.getExceptionCode()
> <<endl
> << e.getMessage().c_str() <<endl
> << e.getType().c_str() <<endl
> << e.getLineNumber <<endl
> << e.getColumnNumber() <<endl;
> throw;
> }
> catch(...){
> cout << "Exeption was thrown" <<endl;
> throw;
> }
> }
The tree that Xalan builds is not mutable. If you check the error code in
the XalanDOMException instance, you'll see that it's
NO_MODIFICATION_ALLOWED_ERR. If you want to do this sort of thing, you'll
need to use the Xerces DOM and our wrapper around their DOM. There is more
information in the documentation and you'll find lots of discussion about
this in the mail archives.
> XalanDocument * _xalanDocument;//not been deleted at the distructor
since
> ParserLiaison owns it
> XalanNode * _contextNode;//not been deleted at the distructor since
delete
> cause segmentation fault-way?
Because the document owns it, and it's destroyed when the document is
destroyed.
...
> hope some one can help
> regards
> Ifat Tankel
Dave