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

BadgerFish shows whitespaces in nodes #4

Open
gordillo-ramon opened this issue Aug 12, 2015 · 0 comments
Open

BadgerFish shows whitespaces in nodes #4

gordillo-ramon opened this issue Aug 12, 2015 · 0 comments

Comments

@gordillo-ramon
Copy link

Hi.

Sometime between 1.2 and 1.3.7 (both versions I have tested), the MappedXMLStreamWriter fixed white-spaces and other blank chars using .trim() for text nodes. However, BadgerFishXMLStreamWriter still shows the issue.

name1 name2

Transforms into:

{"xml":{"$":["\n ","\n ","\n"],"field1":{"$":"name1"},"field2":{"$":"name2"}}}

It is necessary to add the check also in BadgerFishXMLStreamWriter.writeCharacters(String text):

         text = text.trim();
         if (text.length() == 0)
           return;

At the beginning will change the transformation into:

{"xml":{"field1":{"$":"name1"},"field2":{"$":"name2"}}}

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

No branches or pull requests

1 participant