I'm trying to use Nokogiri::XML::Builder.new to create a structure whose root element is called 'file' rather than 'root'.
All of the examples on the Nokogiri documentation site use <root>, and I can't seem to find a way to get it to work with an alternative element name. My code is as follows:
builder = Nokogiri::XML::Builder.new do |xml|
xml.file(:id_=> "", :format=> "", :mimetype=>"", :size=>""){
xml.location(:type=>"")
xml.checksum(:type=>"")
}
That doesn't seem to work. I'm not sure what's going wrong. Any pointers?
Thanks.
<root>in your text. Otherwise it becomes invisible. - LarsH<root>instead of<file>? - LarsH