When I add one node i the DOMDocument that is used to initialize
XercesDocumentWrapper and then tries to use the xpath functions in the wrapper,
to call for the new node my program crashes.
code for adding node:
       DOMElement* nyttElement;

       nyttElement = dokumentM->createElement(XMLString::transcode(element.
     c_str()));

       DOMNode* nyNod;

       nyNod = nyNod2->appendChild(nyttElement->cloneNode(true));

code for xPath call:
  // wrapperM is my XercesDocumentWrapper
  XalanNode* kontextNod = wrapperM->getDocumentElement();
  XalanNode* xalNod= evaluerare.selectSingleNode(domsupport, kontextNod,
    XalanDOMString(xPath.c_str()).c_str()); // xPath is a string with my xPath
    value
  return (DOMNode*)(wrapperM->mapNode(xalNod));

I think this happens because the wrapper not is updated when i make changes in
the DOMDocument.
To solve this problem use the rebuild function:

  wrapperM->rebuildWrapper();

But whit this solution I need to rebuild the hole wrapper document, witch could
be a problem for me when i am using large xml documents.

Is there any functionality where the wrapper is atuomatically updated?

The next best would be a solution where I just have to rebuild the parts that I
have made changes in.

Reply via email to