NodeBuilder.addComment( comment as String ) as This NodeBuilder object
Add an XML comment node to the node tree the builder is building.
Parameters | |
---|---|
comment | The text of the comment. |
const builder = new NodeBuilder(); builder.startElement('example'); builder.addComment('There is no content in this element, just a comment'); builder.endElement(); builder.toNode(); // Returns an XML element node equivalent to the following: // <example><!--There is no content in this element, just a comment--></example>