Skip to content
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
Merged

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

merged 1 commit into from Mar 22, 2014

Conversation

@ghost
Copy link

@ghost ghost 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.

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 issue Mar 22, 2014
…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
Loading
@ddfreyne
Copy link
Member

@ddfreyne ddfreyne commented Mar 22, 2014

Thanks! 👍

Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

1 participant