Hi,
I try to write a XSL to create a CSV file from a XML file.
This is my XML
The output should be the following for this XML:
#SCDB_130km/h,13.73872,46.65472,9.999999999999998
Only Placemarks with #SCDB_130km/h should be written to the file
I've written this XSL but this is far away from my result
Thanks skopeko
P.S: I'm using Xalan
I try to write a XSL to create a CSV file from a XML file.
This is my XML
Code:
<?xml version="1.0" encoding="UTF-8"?>
<Document>
<Placemark>
<visibility>0</visibility>
<description><![CDATA[12, <a href="http://www.scdb.info/software/statistik_detail.php?sc_language_selector=en&speedtraps_id=12" target="_blank">More details</a>]]></description>
<styleUrl>#SCDB_130kmh</styleUrl>
<Point>
<extrude>1</extrude>
<altitudeMode>relativeToGround</altitudeMode>
<coordinates>13.73872,46.65472,9.999999999999998</coordinates>
</Point>
</Placemark>
<Placemark>
<visibility>0</visibility>
<description><![CDATA[2694, <a href="http://www.scdb.info/software/statistik_detail.php?sc_language_selector=en&speedtraps_id=2694" target="_blank">More details</a>]]></description>
<styleUrl>#SCDB_50kmh</styleUrl>
<Point>
<extrude>1</extrude>
<altitudeMode>relativeToGround</altitudeMode>
<coordinates>15.64997,48.21369,9.999999999999998</coordinates>
</Point>
</Placemark>
</Document>
The output should be the following for this XML:
#SCDB_130km/h,13.73872,46.65472,9.999999999999998
Only Placemarks with #SCDB_130km/h should be written to the file
I've written this XSL but this is far away from my result
Code:
<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text"/>
<xsl:template match="/Document">
<xsl:apply-templates />
</xsl:template>
<xsl:template match="/Placemark">
<xsl:if test="styleUrl=SCDB_130kmh">
<xsl:for-each select="styleUrl">
<xsl:value-of select="."/>;<xsl:text/>
</xsl:for-each>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
Thanks skopeko
P.S: I'm using Xalan