[fpc-pascal] TDomNode to text and/or document

Daniel Gaspary dgaspary at gmail.com
Mon Sep 22 14:42:13 CEST 2014

On Mon, Sep 22, 2014 at 8:21 AM, Felipe Monteiro de Carvalho
<felipemonteiro.carvalho at gmail.com> wrote:
> Ummm, this doesn't seam to help much... but I eventually found googling.
> The error is EDOMWrongDocument, which makes sense since I want to
> insert a TDOMNode from another document ... so I have to first import
> and then attach the node:
>   lDoc := TXMLDocument.Create;
>   try
>     lImportedNode := lDoc.ImportNode(ANode, True);
>     lDoc.AppendChild(lImportedNode);

I didn't knew this method, but looking the code I understand why. Is
because it is almost an alias to CloneNode, the method I use.

> By the way, whats the difference between TDOMNode and TDOMElement? Confusing...

TDomNode is the base class, can be an attribute, a Processing
Instruction, a Text node...

TDomElement is one of its descendents.

More information about the fpc-pascal mailing list