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

Allow to prettify XML #59

Merged
merged 1 commit into from
Mar 4, 2016
Merged

Allow to prettify XML #59

merged 1 commit into from
Mar 4, 2016

Conversation

Jeiwan
Copy link
Contributor

@Jeiwan Jeiwan commented Dec 9, 2015

This PR adds :pretty_print, :indent and :compact options to allow prettified XML output.
There is an old PR #35 that has the same purpose, but it stumbled over problems in Builder gem. In this PR I don't mess with Builder gem but instead use REXML from standard Ruby library to format generated XML.
Prettifying doesn't work for XML documents generated from an array without unwrap option set to true as such documents are not valid and cannot be formatted by REXML. This case is just bypassed, no exceptions thrown.

tjarratt added a commit that referenced this pull request Mar 4, 2016
@tjarratt tjarratt merged commit 92ac042 into savonrb:master Mar 4, 2016
@tjarratt
Copy link
Contributor

tjarratt commented Mar 4, 2016

Thanks @Jeiwan !

@xuanyu-h
Copy link

Please build a new version gem and push it to rubygems.org, thanks

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

Successfully merging this pull request may close these issues.

3 participants