AnsweredAssumed Answered

Import XML XSLT FMPXMLRESULT

Question asked by keith.r on Feb 13, 2016
Latest reply on Feb 14, 2016 by beverly

Hello!

I've hit a road block while trying learn importing XML data into FMPA v14.

First question is how to deal with <sky_condition />. Some records have more than one entry.

Second Question is how to deal with <quality_control_flags>. Its seems to be nested with in the record.

 

Any suggestions would be appreciated

 

The XML source is : http://www.aviationweather.gov/adds/dataserver_current/current/metars.cache.xml

 

This is my XSLT so far:

<?xml version='1.0' encoding='UTF-8'?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:template match="/">
<FMPXMLRESULT xmlns="http://www.filemaker.com/fmpxmlresult">
<METADATA>
<FIELD NAME="altim_in_hg" TYPE="TEXT"/>
<FIELD NAME="dewpoint_c" TYPE="TEXT"/>
<FIELD NAME="elevation_m" TYPE="TEXT"/>
<FIELD NAME="latitude" TYPE="TEXT"/>
<FIELD NAME="longitude" TYPE="TEXT"/>
<FIELD NAME="metar_type" TYPE="TEXT"/>
<FIELD NAME="observation_time" TYPE="TEXT"/>
<FIELD NAME="raw_text" TYPE="TEXT"/>
<FIELD NAME="station_id" TYPE="TEXT"/>
<FIELD NAME="temp_c" TYPE="TEXT"/>
<FIELD NAME="wind_dir_degrees" TYPE="TEXT"/>
<FIELD NAME="wind_speed_kt" TYPE="TEXT"/>
</METADATA>
<RESULTSET>
<ROW>
<COL><DATA><xsl:value-of select="@altim_in_hg"/></DATA></COL>
<COL><DATA><xsl:value-of select="@dewpoint_c"/></DATA></COL>
<COL><DATA><xsl:value-of select="@elevation_m"/></DATA></COL>
<COL><DATA><xsl:value-of select="@latitude"/></DATA></COL>
<COL><DATA><xsl:value-of select="@longitude"/></DATA></COL>
<COL><DATA><xsl:value-of select="@metar_type"/></DATA></COL>
<COL><DATA><xsl:value-of select="@observation_time"/></DATA></COL>
<COL><DATA><xsl:value-of select="@raw_text"/></DATA></COL>
<COL><DATA><xsl:value-of select="@station_id"/></DATA></COL>
<COL><DATA><xsl:value-of select="@temp_c"/></DATA></COL>
<COL><DATA><xsl:value-of select="@wind_dir_degrees"/></DATA></COL>
<COL><DATA><xsl:value-of select="@wind_speed_kt"/></DATA></COL>
</ROW>
</RESULTSET>
</FMPXMLRESULT>
  </xsl:template>
</xsl:stylesheet>

Outcomes