I am trying to use Builder to create an XML document for a project that I am working on. Xml has a very strict structure, so I cannot change it. The problem I am facing is this. I am trying to add a child to a node. "linking-phrase-list"
The name of the child should be "linking-phrase". Therefore, for this I would call:
test = Builder.new do |xml|
xml.map {
xml.send(:"linking-phrase-list") {
xml.linking-phrase("label" => "edge1", "id" => "idedge1")
}
}
end
Of course, Ruby interprets this as (xml.linking)-phrase()being completely different from what I want. So I need to know if there is a way to convince Ruby of calling a function not two? Or to tell nokogiri what I mean when I do not use this function.
source
share