New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Honor "omit-xml-declaration" in XSL stylesheets - issue #403 #404

Merged
merged 1 commit into from Mar 22, 2014

Conversation

Projects
None yet
2 participants
@simonsouth
Contributor

simonsouth commented Mar 17, 2014

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.

Honor "omit-xml-declaration" in XSL stylesheets
Setting "omit-xml-declaration='yes'" in an XSL stylesheet is
supposed to suppress the XML declaration ("<?xml... ?>") 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.

ddfreyne added a commit that referenced this pull request Mar 22, 2014

Merge pull request #404 from simonsouth/bug/make-xsl-filter-honor-omi…
…t-xml-declaration

Honor "omit-xml-declaration" in XSL stylesheets - issue #403

@ddfreyne ddfreyne merged commit 8843d30 into nanoc:release-3.6.x Mar 22, 2014

1 check passed

default The Travis CI build passed
Details
@ddfreyne

This comment has been minimized.

Show comment
Hide comment
@ddfreyne

ddfreyne Mar 22, 2014

Member

Thanks! 👍

Member

ddfreyne commented Mar 22, 2014

Thanks! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment