Import the node first, then append it.
On 4 Dec 2012, at 05:09, "subins jose (JIRA)" <xerces-c-...@xml.apache.org> wrote: > > [ > https://issues.apache.org/jira/browse/XERCESC-2005?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel > ] > > subins jose reopened XERCESC-2005: > ---------------------------------- > > > Hi, > > It is not a question. It is a bug. I am using xerces 3.1.1. In this version I > cannot possible to append a node from other document, that was imported. It > throws the WRONG_DOCUMENT_ERR exception . > > Thanks, > >> Cannot possible to append imported node >> --------------------------------------- >> >> Key: XERCESC-2005 >> URL: https://issues.apache.org/jira/browse/XERCESC-2005 >> Project: Xerces-C++ >> Issue Type: Bug >> Components: DOM >> Affects Versions: 3.1.1 >> Environment: Windows XP >> Reporter: subins jose >> Labels: Exception, appendchild, importNode >> Fix For: 3.1.1 >> >> >> I have one node, that is imported from second document. When I try to append >> this node to first node, it throws an exception. >> DOMImplementation* pDOMImplementation = >> DOMImplementationRegistry::getDOMImplementation(XMLString::transcode( "CORE" >> )); >> pDOMParser = >> pDOMImplementation->createLSParser(DOMImplementationLS::MODE_SYNCHRONOUS, 0); >> if( pDOMParser->getDomConfig()->canSetParameter( XMLUni::fgDOMValidate, >> true ) ) >> pDOMParser->getDomConfig()->setParameter( XMLUni::fgDOMValidate, true >> ); >> if( pDOMParser->getDomConfig()->canSetParameter( XMLUni::fgDOMNamespaces, >> true ) ) >> pDOMParser->getDomConfig()->setParameter( XMLUni::fgDOMNamespaces, >> true ); >> if( pDOMParser->getDomConfig()->canSetParameter( >> XMLUni::fgDOMDatatypeNormalization, true ) ) >> pDOMParser->getDomConfig()->setParameter( >> XMLUni::fgDOMDatatypeNormalization, true ); >> pFirstDOMDocumnt = pDOMParser->parseURI(path); >> pSecondDOMDocumnt = pDOMParser->parseURI(path); >> >> ...... >> try >> { >> DOMNode* pImportedNode =pSecondDOMDocumnt->importNode(pChild, true); >> pParent->appendChild(pChildElement); >> } >> catch(DOMException exe) >> { >> fprintf(stdout,"Exception : %S\n",exe.getMessage()); >> } > > -- > This message is automatically generated by JIRA. > If you think it was sent incorrectly, please contact your JIRA administrators > For more information on JIRA, see: http://www.atlassian.com/software/jira > > --------------------------------------------------------------------- > To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org > For additional commands, e-mail: c-dev-h...@xerces.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: c-dev-unsubscr...@xerces.apache.org For additional commands, e-mail: c-dev-h...@xerces.apache.org