Terrain information generator
From MegaMekNET
Terrain information generator is a set of XSL stylesheet that are able to transform terrain.xml to XHTML or WIKI.
Contents |
How to use it ?
- Download terrain information generator archive
- Find a XSLT 2.0 processor, for instance Saxon
- Copy you terrain.xml out of your MegaMekNet server path
- remove the DTD information from the copied terrain.xml (Saxon refuse to validate XML without the attached DTD)
- run terrain2xml.xsl stylesheet on your copied terrain.xml, get the output in a file say output.xml (TIG use a intermediate XML format)
java -jar saxon.jar terrain.xml terrain2xml.xsl > c:\output.xml
- run xml2xhtml.xsl to generate the xhtml output or xml2wikimedia to generate wiki syntax
java -jar saxon.jar output.xml xml2mediawiki.xsl > c:\text_output.txt java -jar saxon.jar output.xml xml2xhtml.xsl > c:\html_output.html
parameters
terrainname
- Please note that you can specify which terrain you wish to generate by using the parameter "terrainname"
java -jar saxon.jar output.xml xml2xhtml.xsl terrainname="Border Town" > c:\html_Border_town.html
- You can also define the terrain number
java -jar saxon.jar output.xml xml2xhtml.xsl terrainname=3 > c:\html_third_terrain.html
- Using "all" or omitting the parameter will output ALL terrains
java -jar saxon.jar output.xml xml2xhtml.xsl terrainname=all > c:\html_all_terrains.html
showimages
- Setting this parameter to other value than "1" (default) will remove all images reference in the output
java -jar saxon.jar output.xml xml2xhtml.xsl showimages=0 > c:\html_terrain_noimage.html

