Is it possible to omit the processing instruction from an XML document using Nokogiri::XML::Builder [duplicate]

混江龙づ霸主 提交于 2020-01-02 21:11:06

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!