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

Add transformTagName to the XMLBuilder #670

Open
1 of 2 tasks
pkuczynski opened this issue Aug 28, 2024 · 4 comments
Open
1 of 2 tasks

Add transformTagName to the XMLBuilder #670

pkuczynski opened this issue Aug 28, 2024 · 4 comments

Comments

@pkuczynski
Copy link

pkuczynski commented Aug 28, 2024

XMLParser has option transformTagName, which allows to mutate tag names on parsing. Similar option would be very useful for XMLBuilder too.

Example usecase:

const builder = new XMLBuilder({
  arrayNodeName: 'book',
  transformTagName: (tag) => tag.toUpperCase()
})

const xml = builder.build([{ author: 'Joe Doe', title: 'Great book'}]);

would produce:

<book>
  <AUTHOR>Joe Doe</AUTHOR>
  <TITLE>Great book</TITLE>
</book>

Would you like to work on this issue?

  • Yes
  • No
Copy link

We're glad you find this project helpful. We'll try to address this issue ASAP. You can vist https://solothought.com to know recent features. Don't forget to star this repo.

@amitguptagwl
Copy link
Member

If I've not implemented it yet then yes it'll be a good enhancement

@pkuczynski
Copy link
Author

If I've not implemented it yet then yes it'll be a good enhancement

Do you want to work on this or shall I provide a PR?

@amitguptagwl
Copy link
Member

Please go ahead with the PR. I would be busy with another repository for some time

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

2 participants