sibprogrammer / xq

Command-line XML and HTML beautifier and content extractor

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

question on xml fusion

fredmo opened this issue · comments

Problem Statement
I have an xml with mutliple time the same name "service" .

Expected Result
I would like to group on all the service having the same in a unique "service name"

Currently I found this command,
xq -x '.[].service |= unique_by(."@name")' my_xml.xml

But it s removing the seconde occurrence having the same service name.
Would you have the advice to fusion on the "service with the same name" ?

Regards

I found a workaround with a python script.