From: Lars Haugseth Date: 2012-10-03T21:07:43+09:00 Subject: Re: Building XML with Nokogiri On 10/03/2012 01:21 PM, ankit j. wrote: > Hi, > > I'm trying to build XML using Nokogiri::XML::Builder, in the following > way: > > builder = Nokogiri::XML::Builder.new do |xml| > xml.rpc { > xml.get-chassis-inventory { > > } > } > end > puts builder.to_xml > > But, the API seems to be having a problem with '-' in the > 'get-chassis-inventory' tag. Any idea how to overcome this? The hyphen is being interpreted by Ruby as a minus operator. You can work around this by using send: xml.send(:"get-chassis-inventory") { } -- Lars Haugseth