I am writing xml exporter in ruby ββand I am using the libxml package for it. I want to write some comment nodes outside the root element
<?xml version="1.0" encoding="UTF-8"?> <root> <childnode /> </root>
How to export to a higher format?
Sample ruby ββcode to generate the above (ignoring the node comment)
doc = XML::Document.new() rootNode = XML::Node.new('root') doc.root = rootNode childNode = XML::Node.new('childnode') childnode << rootNode
source share