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

XMLBuilder no longer calling tagValueProcessor function #437

Closed
4 of 7 tasks
rpastro opened this issue Mar 4, 2022 · 6 comments
Closed
4 of 7 tasks

XMLBuilder no longer calling tagValueProcessor function #437

rpastro opened this issue Mar 4, 2022 · 6 comments
Labels

Comments

@rpastro
Copy link

rpastro commented Mar 4, 2022

  • Are you running the latest version?
  • Have you included sample input, output, error, and expected output?
  • Have you checked if you are using correct configuration?
  • Did you try online tool?

Description

Starting with fast-xml-parser v4.0.2 the XMLbuilder is no longer calling the tagValueProcessor function.

Code

const { XMLBuilder } = require('fast-xml-parser');
const xmlBuilder = new XMLBuilder({
    processEntities: false,
    tagValueProcessor: (tagName, tagValue) => tagValue.toUpperCase()
});
xmlBuilder.build({ root: { test: 'hello' } });

Output

With fast-xml-parser v4.0.1, the output is as expected:

<root><test>HELLO</test></root>

Starting with fast-xml-parser v4.0.2, the tagValueProcessor function is not being called, so the output is:

<root><test>hello</test></root>

expected data

This is existing functionality which was broken by a minor release. Expect functionality is for tagValueProcessor to be invoked for all tags.

Would you like to work on this issue?

  • Yes
  • No
  • If Needed
@github-actions
Copy link

github-actions bot commented Mar 4, 2022

I'm glad you find this repository helpful. I'll try to address your issue ASAP. You can watch the repo for new changes or star it.

@rpastro
Copy link
Author

rpastro commented Mar 4, 2022

I believe this was broken with pull request #426

@amitguptagwl
Copy link
Member

Yes, I also doubt there. And by not having some missing tests it was not caught.

@amitguptagwl
Copy link
Member

Please check v4.0.5

@rpastro
Copy link
Author

rpastro commented Mar 7, 2022

@amitguptagwl This problem has not been solved with v4.0.5. Can you please reopen this issue?

@amitguptagwl
Copy link
Member

Thanks @rpastro . It is fixed now. Releasing v4.0.6

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

No branches or pull requests

2 participants