Is there a way to generate xml tags with dashes in builer?
Imagine I want to generate the following XML:
<ninja-programmer>
Jon Skeet
</ninja-programmer>
I am not able to do it like:
require 'builder'
data = ''
x = Builder::XmlMarkup.new(:target => data, :indent => 2)
x.instruct!
x.ninja-programmer "Jon Skeet"
That would confuse the parser so, how can I do it?
Try declaring it explicitly:
x.tag! "ninja-programmer", "Jon Skeet"
There is a funky way too:
x.send :"ninja-programmer", "Jon Skeet"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With