Skip to content
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

?how to remove a element while merging? #6

Open
aishwaryaanand opened this issue Mar 11, 2018 · 1 comment
Open

?how to remove a element while merging? #6

aishwaryaanand opened this issue Mar 11, 2018 · 1 comment

Comments

@aishwaryaanand
Copy link

I'm trying to combine various xmls into single xml piece , while doing so I want to exclude certain elements
ex:

<root>
<mono>
......
...
</mono>
<view>
</view>
<mono>
</mono>
</root>

I just want the monos
result:

<mono>
</mono>
<mono>
</mono>

I cannot go in each xml and set combine.self= remove for the element view. how to achieve this?

@sentinelt
Copy link
Member

Although there is a filtering capability currently (see: https://github.com/atteo/xml-combiner#filtering) it does not allow to completely remove the elements. It only allows to modify them.

But I suggest to take the resulting Document from XmlCombiner.buildDocument() call, iterate through the XML elements and remove the unnecessary nodes manually based on their tag name. Does not sound that difficult.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants