Skip to content

Allow to prettify XML#59

Merged
tjarratt merged 1 commit intosavonrb:masterfrom
Jeiwan:pretty_print
Mar 4, 2016
Merged

Allow to prettify XML#59
tjarratt merged 1 commit intosavonrb:masterfrom
Jeiwan:pretty_print

Conversation

@Jeiwan
Copy link
Copy Markdown
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
Copy Markdown
Contributor

tjarratt commented Mar 4, 2016

Thanks @Jeiwan !

@xuanyu-h
Copy link
Copy Markdown

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