I'm trying to write a xslt filter for gps-data stored in a gpx xml file. However it doesn't work .
I've found the description for xslt files in this forum, but when I use the example from there (via Copy&Paste), I'll get the same error: OpenOffice calc hangs, the progress bar is at 50%.
My gpx file looks like this:
Code: Select all
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<gpx creator="Mobile Action http://www.mobileaction.com/" version="1.0" xmlns="http://www.topografix.com/GPX/1/0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.topografix.com/GPX/1/0 http://www.topografix.com/GPX/1/0/gpx.xsd">
<trk>
<name>20080501 1753</name>
<desc>Color:008000ff</desc>
<trkseg>
<trkpt lat="51.721268" lon="3.763295">
<time>2008-05-01T15:53:24Z</time>
<speed>0.14</speed>
</trkpt>
<trkpt lat="51.721298" lon="3.763353">
<time>2008-05-01T15:54:12Z</time>
<speed>0.07</speed>
</trkpt>
</trkseg>
</trk>
</gpx>
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns:meta:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" office:version="1.0">
<xsl:template match="gpx">
<office:document>
<office:body>
<office:spreadsheet>
<table:table>
<table:table-row>
<table:table-cell><text:p>lat</text:p></table:table-cell>
<table:table-cell><text:p>lon</text:p></table:table-cell>
<table:table-cell><text:p>time</text:p></table:table-cell>
<table:table-cell><text:p>speed</text:p></table:table-cell>
</table:table-row>
<xsl:for-each select="trk/trkseg/trkpt">
<table:table-row>
<table:table-cell><text:p><xsl:value-of select="@lat"/></text:p></table:table-cell>
<table:table-cell><text:p><xsl:value-of select="@lon"/></text:p></table:table-cell>
<table:table-cell><text:p><xsl:value-of select="time"/></text:p></table:table-cell>
<table:table-cell><text:p><xsl:value-of select="speed"/></text:p></table:table-cell>
</table:table-row>
</xsl:for-each>
</table:table>
</office:spreadsheet>
</office:body>
</office:document>
</xsl:template>
</xsl:stylesheet>