Terrain information generator

From MegaMekNET

Jump to: navigation, search

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 ?

  1. Download terrain information generator archive
  2. Find a XSLT 2.0 processor, for instance Saxon
  3. Copy you terrain.xml out of your MegaMekNet server path
  4. remove the DTD information from the copied terrain.xml (Saxon refuse to validate XML without the attached DTD)
  5. 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
  1. 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
Personal tools