-
-
Notifications
You must be signed in to change notification settings - Fork 309
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
Feature Request: option to ignore attributes by name (by array of string | regex) #666
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. |
this is a good suggestion. We can probably replace ignoreAttributes with this new property. |
Do you need any help with PR? I can work on |
Thanks @mav-rik . I'm busy with a new open source project. So it'll be helpful if you can raise a PR. I'm just thinking from release perspective if we support both properties for sometime with deprecation warning otherwise it'll be a breaking change. |
Why don't just keep backwards compatible ignoreAttributes: boolean | (string | Regex)[] So when it is In this case it won't be a breaking change. |
@amitguptagwl hey can you please take a look PR #668 Codeclimate fails with error "Avoid deeply nested control flow statements". The thing is I didn't add nor remove any of the if/else statements, I only added a few commands inside. In order to resolve Codeclimate error I'll have to refactor the whole thing which I'd like to avoid. |
Thanks for the PR @mav-rik. It looks good to me. However, I still need to check thoroughly. |
Hi, this library is working really well for me, but I had this in my config:
And its working fine in unit tests on my mac, but it behaves as though it were:
in AWS lambda. fast-xml-parser 4.5.0. |
Sorry @jcable , I couldn't understand your concern. |
Description
Please consider adding an option to the parser/builder to exclude certain attributes by name. This could be implemented as an array of attribute names or a RegExp pattern, similar to existing
include
/exclude
API patters for paths (e.g.typescript.json
>exclude
).Use Case
We need to compare two XML documents by parsing and converting them into normalized XML outputs. Sometimes, one XML might contain extra attributes that are irrelevant for our comparison. If we exclude specific attributes during parsing, we'll easily compare the results then.
Suggested API:
Expected Result:
The parser should ignore the specified attributes, ensuring they do not appear in the resulting XML tree.
The text was updated successfully, but these errors were encountered: