Duplicar posible:
Print an XML document without the XML header line at the top¿Cómo puedo generar XML con Nokogiri sin "<? Xml version = ..."?
Tengo un problema con Nokogiri :: XML :: Constructor. Estoy generando XML wth este código:
builder = Nokogiri::XML::Builder.new do
request {
data '1'
}
end
y el resultado es:
<?xml version="1.0" encoding="UTF-8"?><request><data>1</data></request>
¿Cómo puedo quitar:
<?xml version="1.0" encoding="UTF-8"?>
de mi XML?
a recaudar error (Documento ya tiene un nodo raíz). Pero builder.parent.root.to_s no. Gracias. Me haces ver bien) – mibon
Debe ser 'builder.doc.root.to_xml' (o' to_s'). – Phrogz