Unformatted XML is a problem in our build. I would like to include style checking for XML documents, primarily looking for poor indentation.
What is the best tool to use? (The build uses Ant).
Unformatted XML is a problem in our build. I would like to include style checking for XML documents, primarily looking for poor indentation.
What is the best tool to use? (The build uses Ant).
On
Check XCOP: http://www.yegor256.com/2017/08/29/xcop.html
This is how you integrate it with ant:
<project>
<target name="xcop">
<apply executable="xcop" failonerror="true">
<fileset dir=".">
<include name="**/*.xml"/>
<include name="**/*.xsd"/>
<exclude name="target/**/*"/>
<exclude name=".idea/**/*"/>
</fileset>
</apply>
</target>
</project>
You can write a class that will automatically transform and therefore indent your XML. Then just specify in Ant on which XML files it should be ran.
Something to get you started: