[fedora-java] xml manipulation

Mikolaj Izdebski mizdebsk at redhat.com
Tue Mar 10 07:17:24 UTC 2015


On 03/09/2015 09:10 PM, Orion Poplawski wrote:
> Is it possible to use %pom_xpath_remove (or similar) to edit an arbitrary xml
> file?  I'd like to remove from:

Yes, it should work.

> releng/org.eclipse.ptp.repo/category.xml:
> 
> <site>
>  ...
>    <feature url="features/org.eclipse.ptp.rdt.sync.fortran_0.0.0.jar"
> id="org.eclipse.ptp.rdt.sync.fortran" version="0.0.0">
>       <category name="Remote Development Tools"/>
>    </feature>
> ...
> </site>

I've just verified it with:

$ cat /tmp/feature.xml
<site>
   <feature url="features/org.eclipse.ptp.rdt.sync.fortran_0.0.0.jar"
id="org.eclipse.ptp.rdt.sync.fortran" version="0.0.0">
      <category name="Remote Development Tools"/>
   </feature>
</site>

$ python3 /usr/share/java-utils/pom_editor.py pom_xpath_remove feature
/tmp/feature.xml

$ cat /tmp/feature.xml
<site>
   </site>


-- 
Mikolaj Izdebski
Software Engineer, Red Hat
IRC: mizdebsk


More information about the java-devel mailing list