oozcitak / xmlbuilder2

An XML builder for node.js
362 stars 35 forks source link

fix(94): fix formatting to be compliant with XMLBuilder #180

Open mdovhopo opened 4 months ago

mdovhopo commented 4 months ago

Please include a summary of the change and which issue is fixed. Fixes # (issue number)

Type of change:

This PR should fix previously reported issue https://github.com/oozcitak/xmlbuilder2/issues/94 that i also encountered. current pretty print in XMLBuilderCB prints values on separate lines like:

<Root>
   <Test>
   value
   </Test>
</Root>

but it should be

<Root>
   <Test>value</Test>
</Root>

the main problem is that pretty printed xml in that way may not pass xsd validation, because printer adds spaces and '\n's.

This might be a naive approach, so i would appreciate review from codeowner