← Back to team overview

openerp-expert-framework team mailing list archive

standardized xml formatting

 

Hi experts!

xml files are currently not formatted following a unified coding guideline and 
extremly difficult to read

we propose to format all xml files using the attached style sheet.
the attached script must be adapted to local directory structure
saxon must be installed

For quick comparison see the attached account_view xml files

what it does:
* 2 spaces indent (makes deep structures more readable)
* breaks contents of fields like button, menu etc and column names with 
typically long - and hence not readable - attributes (on change, colors, 
attrs, ... ) in new lines, which are sorted alphabetically (see line 90 of 
xslt)

To be discussed - why do we need multiple &quot can't this be replaced by 
multiple " or ' ? see line 75 of formatted xml

-- 
Best Regards

ChriCar Beteiligungs- und Beratungs- GmbH
http://www.chricar.at/ChriCar/index.html
Dr. Ferdinand Gassauer
Official Tiny Partner
v="$1"

format_spec="/home/gass/Documents/SVN/trunk/trunk/OpenERP/utilities/Format_OpenERP.xslt"
java -jar /usr/share/java/saxon.jar  $v $format_spec  | sed -e 's/\&#34/\&quot/g'


Attachment: Format_OpenERP.xslt
Description: XML document

Attachment: account_view.xml
Description: XML document

Attachment: account_view.formatted.xml
Description: XML document


Follow ups