Nokogiri saves XML attributes with double quotes, even if DOM it read had single quotes. This is totally legitimate of course, but it introduces annoying changes to file content
It looks like the answer is no; not as the library is currently written, and maybe not at all. Tracing the call path for a node's serialization:
Nokogiri::XML::Node#to_s
calls to_xml
Nokogiri::XML::Node#to_xml
calls serialize
(sets a few default options)Nokogiri::XML::Node#serialize
calls write_to
Nokogiri::XML::Node#write_to
calls native_write_to
Nokogiri::XML::Node#native_write_to
calls native_write_to
, which looks like this:&bsp;
def native_write_to(io, encoding, indent_string, options)
set_xml_indent_tree_output 1
set_xml_tree_indent_string indent_string
savectx = LibXML.xmlSaveToIO(IoCallbacks.writer(io), nil, nil, encoding, options)
LibXML.xmlSaveTree(savectx, cstruct)
LibXML.xmlSaveClose(savectx)
io
end
So, you are at the mercy of libxml at this point. Googling for libxml serialize single quote attributes does not immediately turn up any smoking guns.
I think you should file a feature request and see what sort of tenderlovin' you can get. :)