NaturalIntelligence / fast-xml-parser

Validate XML, Parse XML and Build XML rapidly without C/C++ based libraries and no callback.
https://naturalintelligence.github.io/fast-xml-parser/
MIT License
2.49k stars 302 forks source link

transformTagName add node attr value as parameter #531

Closed frankie-zeng closed 1 year ago

frankie-zeng commented 1 year ago

Description

I want use attribute as tag name.

<var name="hello" type="INTEGER" value="22"> <a name="world" value="@DEF"/> </var>

open output: { hello:{ world:{ ** } } }

github-actions[bot] commented 1 year ago

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.

amitguptagwl commented 1 year ago

I feel it is very specific need. I'll suggest to use ordered parsed output and write a function on top it. It'll not take much time. Otherwise, I might think about it if there are more users for this feature.

amitguptagwl commented 1 year ago

updateTag option is added to the parser v4.2 to change attributes or tagName. Check solothought post for detail example.