nanoc/nanoc — pull request #404 by simonsouth (2014-03-17 13:43:48+00:00)
Title: Honor "omit-xml-declaration" in XSL stylesheets - issue #403

See issue #403, "XSL filter ignores "omit-xml-declaration" setting in stylesheets".

Setting "omit-xml-declaration='yes'" in an XSL stylesheet is
supposed to suppress the XML declaration ("") at the top
of the generated output. However, this setting was being ignored by
nanoc's XSL filter, which caused problems when it was used to
generate XML fragments for inclusion in other layouts.

The problem was that Nokogiri was being invoked in a way that
returned an object representing the transformed XML document.
Fetching the string representation of this document then naturally
caused a fresh XML declaration to be generated.

This change makes the filter retrieve from Nokogiri the raw text of
the transform's output so that any omitted elements remain omitted.