Am Thu, 10 Apr 2008 13:14:13 +0200 schrieb Ferdinand Knapitsch: > Hi! > > I'm using XERCES-C 2.8 to read a file. It looks like this: > > <?xml version="1.0" encoding="UTF-8" standalone="no" ?> > <!-- comment this --> > <TEST> > <VALUE> > <ONE>textoneONE</ONE> > <ONE>textoneTWO</ONE> > <TWO attr="2.1"/> > <TWO attr="2.2"/> > <TWO attr="2.3"/> > <THREE>textthree</THREE> > </VALUE> > </TEST> > > After parsing the document it looks like this: > > <?xml version="1.0" encoding="UTF-8" standalone="no" ?><TEST> > <VALUE> > <ONE>textoneONE</ONE> > <ONE>textoneTWO</ONE> > <TWO attr="2.1"/> > <TWO attr="2.2"/> > <TWO attr="2.3"/> > <THREE>textthree</THREE> > </VALUE> > </TEST> >
It seems that I loose the comments when I'm cloning the DomDocument with this code: newDoc->appendChild(newDoc->importNode(oldDoc->getDocumentElement(),(true))); why does the DOMDocument::cloneNode() do not work? It fails with an segmentation fault. Does anybody know here how I do best? Best regards, Ferdinand
