Adding a comment to an XML node

 Delphi  Comments Off on Adding a comment to an XML node
May 102017
 

So I don’t forget:

Adding a comment to an existing IXMLNode is simple, once you find out how:

var
  CommentNode: IXMLNode;
begin
  CommentNode := ParentNode.OwnerDocument.CreateNode('comment text', ntComment);
  ParentNode.ChildNodes.Add(CommentNode);

This is documented in the DocWiki

 Posted by on 2017-05-10 at 17:21