Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 405865

Summary: javatoolkit improvement for xpath-like xml handling
Product: Gentoo Linux Reporter: Karsten Merkle <gentoo>
Component: [OLD] JavaAssignee: Java team <java>
Status: UNCONFIRMED ---    
Severity: enhancement    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: javatoolkit-0.3.0-match.patch
javatoolkit-0.3.0-match.patch

Description Karsten Merkle 2012-02-26 09:31:47 UTC
this patch allows changing, deleting and adding of elements as well as attributes in xml documents like pom.xml or build.xml.
Example:
xml-rewrite-2.py -c -a srcdir -v src -m //project/target@[name="compile"]/javac
would change the value of attribute srcdir to "src" only in the 'target' element which attribute 'name' is "compile" following the root //project.

xml-rewrite-2.py -c -a todir -v bin -m target/copy@[todir="pkg"] 
would change every 'todir' attribute value to 'bin' which previous value was 'pkg' and is in a 'copy' element surrounded by a 'target' element

furthermore not only matching -m is added but qualification -q

Example:
xml-rewrite-2.py -d -a depends -m target -q copy@[todir="win32"]
would delete all 'depends attributes' of 'target' elements wich do include a 'copy' element with an attribute 'todir' with the value 'win32'



Reproducible: Always
Comment 1 Karsten Merkle 2012-02-26 09:32:53 UTC
Created attachment 303293 [details, diff]
javatoolkit-0.3.0-match.patch
Comment 2 Karsten Merkle 2012-02-26 15:48:58 UTC
Created attachment 303357 [details, diff]
javatoolkit-0.3.0-match.patch

revised version