axelpale / filterxml

Simplify your XML by removing XML nodes that match XPath expressions
MIT License
2 stars 2 forks source link

Support removing attribute #1

Open tan-tan-kanarek opened 6 years ago

axelpale commented 6 years ago

Hi Tan, thanks for the PR! Great!

Before I am able to merge, may I ask you to do the following:

By the way, if you are applying the filterxml module in a public project, I am happy to add a link to your project into README.md. It is always nice to know what people are building with tools we create :)

axelpale commented 6 years ago

Hi, maybe we are too busy right now, but no worries, it is the part of the open source biz :) However, I need to close the PR soon because I am unable to understand the committed feature without your explaination and an example. Do not worry about lint issues, I can fix those, they are a minor thing.

tan-tan-kanarek commented 6 years ago

Sorry @axelpale, I moved to a different project and forgot about it. I used it here: https://github.com/kaltura/api-gw/blob/d38d65eb8ea6da82cbd115683206ebbcddcbe4f1/lib/enrichers/xml-reducer.js

The tests that required this fix are here: https://github.com/kaltura/api-gw/blob/d38d65eb8ea6da82cbd115683206ebbcddcbe4f1/test/xml-reducer.test.js Note to all the xPaths that include @, they all refer to XML attribute and not to XML element (e.g. lines 15 and 97).

T.