Thursday, 5 September 2013

How to add/insert a xml node into text

How to add/insert a xml node into text

I am generating a text document in the open document format (odt) which is
based on XML. But I have a problem when adding a tabulator in a text
passage. When I create it in the Open Office application and save the
document the passage has the internal XML representation as:
<text:p text:style-name="P5">Prepared by: <text:tab/>Tim Test</text:p>
When generating it automatically I come to this part in my source code:
Node, Node1: IXMLNode;
...
Node := Node1.AddChild('text:p');
Node.Attributes['text:style-name'] := 'P5';
Node.Text := 'Prepared by: Tim Test';
But I can't find any method to add the node into the text before "Tim", or
at least not with the internal Delphi XML library.
Is there a way to achieve it or is there any other Delphi XML library
which can do that?

No comments:

Post a Comment