Last active
April 1, 2019 21:17
-
-
Save fetis/15e7cf3c22885bda31d0472718fd3da5 to your computer and use it in GitHub Desktop.
Railway Empire tools. Export cities from Tile map to CSV file. You can import this file in Tome editor to update/create cities.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | |
xmlns:xs="http://www.w3.org/2001/XMLSchema" | |
exclude-result-prefixes="xs" | |
version="2.0"> | |
<xsl:output method="text"></xsl:output> | |
<xsl:template match="/">ID;DisplayName;NameId;TownFounded;TownActive;TownFactory0;TownFactory1;TownFactory2;TownPopulation<xsl:text> | |
</xsl:text> | |
<xsl:apply-templates select="//objectgroup[contains(@name, 'city_')]"></xsl:apply-templates> | |
</xsl:template> | |
<xsl:template match="objectgroup"> | |
<xsl:variable name="id" select="substring(@name, 6)"/> | |
<xsl:variable name="nameId" select="properties/property[@name = 'nameid']/@value"/> | |
<xsl:variable name="founded" select="properties/property[@name = 'founded']/@value"/> | |
<xsl:variable name="production1" select="properties/property[@name = 'production1']/@value"/> | |
<xsl:variable name="production2" select="properties/property[@name = 'production2']/@value"/> | |
<xsl:variable name="production3" select="properties/property[@name = 'production3']/@value"/> | |
<xsl:variable name="population" select="properties/property[@name = 'population']/@value"/> | |
<xsl:value-of select="string-join(($id, $id, $nameId, $founded, 'true', $production1,$production2, $production3, $population), ';')"/><xsl:text> | |
</xsl:text> | |
</xsl:template> | |
</xsl:stylesheet> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment