xml-js icon indicating copy to clipboard operation
xml-js copied to clipboard

Empty xml when not options.compact

Open euberdeveloper opened this issue 6 years ago • 3 comments

When there is not the option attribute compact: true, neither js2xml nor json2xml work, they return instead undefined

euberdeveloper avatar May 11 '18 20:05 euberdeveloper

@euberdeveloper Experiencing exact same issues. I replaced an old XML parser in my project with this library and then wasted hours because of this issue. Thanks for telling that compact is working

sandgupta23 avatar May 12 '18 08:05 sandgupta23

@euberdeveloper , @sangupta007

Sorry for the inconveniences caused by this.

I admit the documentation doesn't tell or warn the library works in non-compact form by default. I got tripped into this issue many times myself 😅.

I will update the documentation to clarify this default. I might also let the library automatically switch the behavior to compact form if the input is in compact form.

nashwaan avatar May 17 '18 06:05 nashwaan

Man, I spent few hours researching this issue until I found this report. I should have come here in the first place anyway.

Thanks @nashwaan for such a great library. Saved me a lot of work!

fermartz avatar Jul 26 '18 14:07 fermartz