Pass tag name to "tagValueProcessor" and "attrValueProcessor"
See original GitHub issueWhat do you think about passing a tag name to tagValueProcessor
and attrValueProcessor
?
That’s might be helpful to choose parse logic depends on tags name (my case).
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
fast-xml-parser/docs.md at master - GitHub
When function a tag name is passed to the callback that can be checked. tagValueProcessor : Process tag value during transformation. Like HTML...
Read more >fast-xml-parser/README.md - UNPKG
Instead, use tagValueProcessor, and attrValueProcessor. See above example. ... When `function` a tag name is passed to the callback that can be checked....
Read more >fast-xml-parser - npm
tagValueProcessor : Process tag value during transformation. Like HTML decoding, word capitalization, etc. Applicable in case of string only.
Read more >Parse XML to JSON with JavaScript - Morioh
Instead, use tagValueProcessor, and attrValueProcessor. See above example. ... When function a tag name is passed to the callback that can be checked....
Read more >To Get Tag value by passing Tag name from a string in XML ...
You should be able to do records."$tag".text().
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@infacto @amitguptagwl Hello everyone!
Shouldn’t the
tagValueProcessor
signature be something like this?tagValueProcessor: (tagName: string, tagValue: string, jPath: string, hasAttributes: boolean, isLeafNode: boolean) => unknown;
Instead of returning a
string
?Otherwise I’m missing the point… I would use it like that
Or there is any other way to achieve it?
Ah! my bad. Yes, it passes their values. We can modify it to pass the tag name.