I'm needing to parse a particular set of XML files for a value.
In this instance, I need to find every access id for <group>THISGROUP</group>
with <permission>WRITE</permission>
In the example below, I would need VX-3422867
returned. Also, I need to be able to accomplish this within a bash script.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<AccessControlListDocument>
<access id="VX-3422867">
<loc>http://localhost:8080/API/item/VX-410070/access/VX-3422867</loc>
<grantor>admin</grantor>
<recursive>true</recursive>
<permission>WRITE</permission>
<group>THISGROUP</group>
</access>
<access id="VX-3422866">
<loc>http://localhost:8080/API/item/VX-410070/access/VX-3422866</loc>
<grantor>admin</grantor>
<recursive>true</recursive>
<permission>NONE</permission>
<operation>
<shape>
<tag>original</tag>
</shape>
</operation>
<group>THISGROUP</group>
</access>
<access id="VX-3422865">
<loc>http://localhost:8080/API/item/VX-410070/access/VX-3422865</loc>
<grantor>admin</grantor>
<recursive>true</recursive>
<permission>WRITE</permission>
<group>TWO</group>
</access>
<access id="VX-3422869">
<loc>http://localhost:8080/API/item/VX-410070/access/VX-3422869</loc>
<grantor>admin</grantor>
<recursive>true</recursive>
<permission>ALL</permission>
<group>THREE</group>
</access>
<access id="VX-3422868">
<loc>http://localhost:8080/API/item/VX-410070/access/VX-3422868</loc>
<grantor>admin</grantor>
<recursive>true</recursive>
<permission>ALL</permission>
<group>FOUR</group>
</access>
<access id="VX-975588">
<loc>http://localhost:8080/API/item/VX-410070/access/VX-975588</loc>
<recursive>true</recursive>
<permission>OWNER</permission>
<user>user-one</user>
</access>
</AccessControlListDocument>