I am working in a project where people upload GPX and I am trying to convert a GPX file into a KML file, so they have the option of downloading in both formats.
I found a XSLT file that supposedly transforms GPX into KML but when I try to do the conversion in php using XSLTProcessor, it gives me some errors saying that some functions are not found. I checked the XSLT file and those functions are there. I am not very familiar with XSLT so if anyone can give me some direction that would be great.
The xslt file is located here: http://members.home.nl/cybarber/geomatters/FlitspaalGPX2KML.xslt
The gpx file is located here: http://geobetty.com/maps/download/8/archuletas-acres.gpx
Here is the code:
<?php
$gpx = new DOMDocument();
$gpx->loadXML($ride);
$xslsheet = new DOMDocument();
$xslsheet->load(DOCROOT . '/lib/gpx-to-kml.xslt');
$xsl = new XSLTProcessor();
$xsl->importStyleSheet($xslsheet);
$kml = $xsl->transformToXML($gpx); ?>
These are my errors:
xmlXPathCompOpEval: function distCosineLaw not found Unregistered function xmlXPathCompiledEval: 3 objects left on the stack
Among others