I would like to be able to pass an XML file to an ANT build script and have it create a folder structure mimicking the nodal structure of the XML, using the build files parent directory as the root.
For Example using:
<root>
<folder1>
<folder1-1/>
</folder1>
<folder2/>
<folder3>
<folder3-1/>
</folder3>
</root>
ant would create:
folder1
-folder1-1
folder2
folder3
-folder3-1
I know how to create a directory, but i'm not sure how to have ANT parse the XML.
One option would be to use the xslt task to do the heavy lifting. For example, generate a second ant script and invoke it.
build.xml:
Place mkdir.xslt in the same directory as build.xml:
Example mkdir.build.xml output from the xslt task:
I'm not fluent in XSLT, so it might be possible to improve on the for-each loop.