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

DefaultXmlPrettyPrinter indentation configuration not preserved #222

Closed
jtuc opened this issue Feb 14, 2017 · 0 comments
Closed

DefaultXmlPrettyPrinter indentation configuration not preserved #222

jtuc opened this issue Feb 14, 2017 · 0 comments
Milestone

Comments

@jtuc
Copy link

jtuc commented Feb 14, 2017

I want to prettyprint XML with a \n character, disregarding the system dependent line feed/carriage return settings.

I thought that the following code would be sufficient:

XmlMapper xmlMapper = new XmlMapper();
DefaultXmlPrettyPrinter pp = new DefaultXmlPrettyPrinter();
pp.indentObjectsWith(new Newline2SpacesIndenter());
ObjectWriter xmlWriter = xmlMapper.writer(pp);

Where Newline2SpacesIndenter() is my custom indenter.

However, attempting to use the resulting ObjectWriter doesn't result in the expected behaviour - the customized indenter is lost, as DefaultXmlPrettyPrinter.createInstance() doesn't preserve configuration.

Is this a bug, or am I attempting to configure things in the wrong place?

@cowtowncoder cowtowncoder added this to the 2.8.7 milestone Feb 15, 2017
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

No branches or pull requests

2 participants