3 Replies Latest reply on May 6, 2009 7:24 AM by comment_1

    FileMaker Table to xml using xsl for import to Google Earth

    thehammer

      Title

      FileMaker Table to xml using xsl for import to Google Earth

      Post

      I am attempting to move a large table of Lats and Lons into Google Earth as points. I know that I can generate the proper xml. It read's as follows:

       

      <?xml version="1.0" encoding="UTF-8"?>

      <kml xmlns="http://www.opengis.net/kml/2.2">

      <Placemark>

        <name>Berea College</name>

        <description>Berea College</description>

        <Point>

          <coordinates>-084.235247,+37.592589,0</coordinates>

        </Point>

      </Placemark>

      </kml>

       

      The table in FileMaker is a simple table with Latitude, Longitude, Zip Code...and other fields. I would like to export the table into the above kml  format but can't seem to get the xsl to work with. I receive the following error:

       

      XML Parsing Error: Unterminated entity declaration, 'ContentType'  Line Number: 81 Column Number 5.

       

      Any help on the subject of exporting FileMaker tables to xml using xsl would be very helpful.

       

      Thanks 

        • 2. Re: FileMaker Table to xml using xsl for import to Google Earth
          thehammer
            

          I believe my problem lies with this statement:

           

          <xsl:value-of select="fmp:COL[1]/fmp:DATA"/>

           

          I've written xsl before, but it was transforming an Access database and the syntax read more like this:

           

          <xsl:value-of select="@fieldname"/>

           

          I've written a test to access just one field on a one field table. The xsl of this test looks like this:

           

          <?xml version="1.0" encoding="utf-8"?>

           

          <xsl:styPlacemarklesheet version="1.0"

          xmlns:xsl="http://www.w3.org/1999/XSL/Transform"

          xmlns:fmp="http://www.filemaker.com/fmpxmlresult"

          xmlns:kml="http://earth.google.com/kml/2.2"

          exclude-result-prefixes="fmp">

           

          <xsl:output method="xml" version="1.0" encoding="utf-8" indent="yes" />

           

          <!--

          Copyright © 2007 *COMMENT Visual Realisation

          All rights reserved.

          -->

           

          <!-- BEGIN TEMPLATE -->

          <xsl:template match="/">

           

          <kml>

          <Document>

          <!-- BEGIN RECORD -->

          <xsl:for-each select="fmp:FMPXMLRESULT/fmp:RESULTSET/fmp:ROW">

           

          <Placemark>

           

          <name>

          <!-- FIELD 1 -->

          <xsl:value-of select="fmp:COL[1]/fmp:DATA"/>

          </name>

           

           

          <!-- END RECORD -->

          </Placemark>

          </xsl:for-each>

           

          </Document>

          </kml>

          </xsl:template>

          </xsl:stylesheet>

           

           

          I receive an error when I try to export this that reads:

           

          XML Parsing Error:

           

          Invalid Document Structure

           

          Line Number: 1 

          Column Number: 1 

           

          Maybe one of my questions is, what does fmp:COL[1]/fmp:DATA refer to? 

          • 3. Re: FileMaker Table to xml using xsl for import to Google Earth
            comment_1
              

            theDEWD wrote:

            I believe my problem lies with this statement:

             

            <xsl:value-of select="fmp:COL[1]/fmp:DATA"/>

             ...

            what does fmp:COL[1]/fmp:DATA refer to? 


            It refers to contents of the first field (in the order of export) of the currently processed record. You need to look at the raw XML ouptput in order to understand why and how it works (make sure you are specifying FMPXMLRESULT grammar when exporting).

             

             

            ---

            P.S. I don't think you should copy-paste an entire copyrighted document here.