-
-
Notifications
You must be signed in to change notification settings - Fork 307
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
XMLParser - tagValueProcessor
called only on leaf nodes
#657
Comments
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. |
As I remember, it is called only when a tag has (text) value. This is what mentioned in the documentation "if tag value is empty then tagValueProcessor will not be called." You can probably try v5. it is experimental. But you can find features of your need. Please see documentation. |
please reopen if you still any issue |
Hi @amitguptagwl, sorry for the late reply, I had indeed not fully understood the precision in the doc:
So, this is effectively not a bug, you can close this issue. I've finally managed to perform what I wanted by doing differently, however an option to control how tags should be parsed would be nice! (I did not try v5 for the moment) Thanks again |
If you're trying this library first time then better to have a look of v5. There you can customize the parsing very well. |
Description
Hi, I think I found a bug in how
tagValueProcessor
is executed inXMLParser
class. It seems to be called only on leaf nodes (see sample code below).I searched for similar issues but none seem related, however there is a similar (closed) one for XMLBuilder:
Code
then run
node test.js
in a terminalOutput
You should see only 2 logs for the
customTagValueProcessor
function:And the parsed data (which is properly parsed in this case)
Expected data
As said previously, the data is properly parsed, however I would expect that the
customTagValueProcessor
function would be called on any node (and not only leaf nodes), and the output should be something like (probably not in this order):Would you like to work on this issue?
Is it an expected behaviour of the
tagValueProcessor
attribute on XMLParser?Thanks the project 🙏
The text was updated successfully, but these errors were encountered: