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

Format XML string with different indents for nodes of different levels #124

Open
mstarodubtsev opened this issue Sep 13, 2016 · 1 comment

Comments

@mstarodubtsev
Copy link

mstarodubtsev commented Sep 13, 2016

It is more convenient to see the printed XML document as the string with different indents for every level of the nodes hierarchy.
So we can get (maybe xml.toPrettyString()):

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<xml>
    <level1>
        <level2>
            <level3/>
            <level3/>
        </level2>
    </level1>
</xml>

Instead of (now xml.toString(), with default javax.xml.transform.TransformerFactory):

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<xml>
<level1>
<level2>
<level3/>
<level3/>
</level2>
</level1>
</xml>

@mstarodubtsev mstarodubtsev changed the title Print XML string with increasing indents for nodes of different levels Format XML string with different indents for nodes of different levels Sep 14, 2016
@dmarkov
Copy link

dmarkov commented Sep 19, 2016

@yegor256 dispatch this issue please, see par.21

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

No branches or pull requests

3 participants