issue
Some xml attributes are incorrectly sorted and indented.
solution
make them pretty again.
# Transform all template XML files with a specific XSL stylesheet: find ~/0ad/binaries/data/mods/public/simulation/templates -name '*.xml' -print0 | while IFS= read -r -d '' file; do xsltproc -o "$file" ~/0ad/source/tools/templatessorter/templatessorter.xsl "$file"; done
removal of the standalone tag
I don't understand the purpose of the standalone="no" tag, below some related IRC conversations about it. Can I remove them?
The XML standalone element defines the existence of an externally-defined DTD. In the message tree it is represented by a syntax element with field type XML.standalone.
Source: XML.standalone
- No .dtd files, no need for standalone="no" !
note
- This patch does not touch any template xml files that have comments in them, see #4550 for more details.
- the order demands all comments to be listed below <Entity parent=... rather than leaving the comments near the component
- corpse.xml is such a candidate with lots of comments
- No changes are made to some files, but all their contents are listed, e.g. tent_mace.xml. I suspect that it is just the line terminators.
# this patch being applied file --brief tent_mace.xml XML 1.0 document text, ASCII text #without the patch (rP27025) file --brief tent_mace.xml XML 1.0 document text, ASCII text, with CRLF line terminators
mods
Mods like Delenda Est (@wowgetoffyourcellphone ) can also apply the Template Sorter to their files.
# 1st file path to the template folder # 2nd file path to the templatessorter.xsl file find ~/Library/Application\ Support/0ad/mods/delenda_est/simulation/templates -name '*.xml' -print0 | while IFS= read -r -d '' file; do xsltproc -o "$file" ~/0ad/source/tools/templatessorter/templatessorter.xsl "$file"; done # Number of affected files git diff --stat | tail -1 242 files changed, 942 insertions(+), 942 deletions(-) # 1 error ./skirmish/units/default_support_slave_female.xml:1: parser error : Start tag expected, '<' not found 5<?xml version="1.0" encoding="utf-8"?> ^ unable to parse ./skirmish/units/default_support_slave_female.xml