I made the following function to print the XML data of a specified node, but 
when I try to append pNodo2 to teh DOMElement pRoot the program crashed with a 
SIGSEG violatioation.
I there an error or I missed something in the code belowe ?

regards, Enzo 

/******************************************/
int
util_xerces::PrintXmlNode( DOMNode * pNodo,
                           string & strDescr )
{
  DOMDocument *pDoc;
  DOMElement *pRoot;
  DOMNode  *pNodo2 = 0;
  string    strXmlInp = "<NODO/> ";
  int iret = IRET_ERROR;

  strDescr = "";
  DOMImplementation *impl = DOMImplementationRegistry::getDOMImplementation( X( 
"LS" ) );

  if( impl != NULL )
  {
    pDoc = impl->createDocument( 0, X( "Messaggio" ), 0 );
    pDoc->setEncoding( X( "UTF-8" ) );
    pRoot = pDoc->getDocumentElement();
    pNodo2 = pNodo->cloneNode( true );
    pRoot->appendChild( pNodo2 );          << ----- SEGMENTATION FAULT 
**************
    strDescr = util_xerces::GetStringFromDOMDocument( pDoc, true );
    pDoc->release();
    iret = IRET_OK;
  }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to