Comments in REXML

How do I add a XML comment between 2 element nodes in REXML? I’ve read
the documentation over and over, but I just can’t find out…

Best regards,

Jari W.

require “rexml/document”

doc =’’)

doc.root <<‘elem1’)
doc.root <<‘this is a comment’)

res = doc.to_s # => “”

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs