问题
Possible Duplicate:
Print an XML document without the XML header line at the top
I'm trying to create a fragment of XML using the Nokogiri::XML::Builder but I can't find any documentation on how to exclude the processing instruction (<?xml version=...
)
Can anyone point me in the right direction?
回答1:
Now I can answer:
doc.to_xml :save_with => Nokogiri::XML::Node::SaveOptions::NO_DECLARATION
来源:https://stackoverflow.com/questions/7215508/is-it-possible-to-omit-the-processing-instruction-from-an-xml-document-using-nok