AnsweredAssumed Answered

Import from XML Problem

Question asked by OkcunSahin on Mar 5, 2012
Latest reply on Mar 9, 2012 by OkcunSahin

Title

Import from XML Problem

Post

Hi I am trying to get data from a weather site. Site is already offering xml. The xml is like this;
<observations>
<observation>
<date>
<pretty>Saat: 12:20 AM EET Tarih: 31 Aralık 2011</pretty>
<year>2011</year>
<mon>12</mon>
<mday>31</mday>
<hour>00</hour>
<min>20</min>
<tzname>Europe/Istanbul</tzname>
</date>
<utcdate>
<pretty>Saat: 10:20 PM GMT Tarih: 30 Aralık 2011</pretty>
<year>2011</year>
<mon>12</mon>
<mday>30</mday>
<hour>22</hour>
<min>20</min>
<tzname>UTC</tzname>
</utcdate>
<tempm>-3.0</tempm>
<tempi>26.6</tempi>
<dewptm>-4.0</dewptm>
<dewpti>24.8</dewpti>
<hum>93</hum>
<wspdm>3.7</wspdm>
<wspdi>2.3</wspdi>
<wgustm>-9999.0</wgustm>
<wgusti>-9999.0</wgusti>
<wdird>0</wdird>
<wdire>Değişken</wdire>
<vism>8.0</vism>
<visi>5.0</visi>
<pressurem>1014</pressurem>
<pressurei>29.95</pressurei>
<windchillm>-999</windchillm>
<windchilli>-999</windchilli>
<heatindexm>-9999</heatindexm>
<heatindexi>-9999</heatindexi>
<precipm>-9999.00</precipm>
<precipi>-9999.00</precipi>
<conds>Çok Bulutlu</conds>
<icon>mostlycloudy</icon>
<fog>0</fog>
<rain>0</rain>
<snow>0</snow>
<hail>0</hail>
<thunder>0</thunder>
<tornado>0</tornado>
<metar>
METAR LTAC 302220Z VRB02KT 8000 SCT040 BKN100 M03/M04 Q1014 NOSIG
</metar>
</observation>
<observation>

So I created this xls file;

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

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

<xsl:template match="/">

<FMPXMLRESULT xmlns="http://www.filemaker.com/fmpxmlresult">
<ERRORCODE>0</ERRORCODE>
<PRODUCT BUILD="" NAME="" VERSION=""/>
<DATABASE DATEFORMAT="" LAYOUT="" NAME="" RECORDS="" TIMEFORMAT=""/>

<METADATA>
<FIELD NAME="yil" TYPE="NUMBER" EMPTYOK="YES" MAXREPEAT=""/>
<FIELD NAME="ay" TYPE="NUMBER" EMPTYOK="YES" MAXREPEAT=""/>
<FIELD NAME="gun" TYPE="NUMBER" EMPTYOK="YES" MAXREPEAT=""/>
<FIELD NAME="saat" TYPE="NUMBER" EMPTYOK="YES" MAXREPEAT=""/>
<FIELD NAME="dakika" TYPE="NUMBER" EMPTYOK="YES" MAXREPEAT=""/>
<FIELD NAME="sicaklik" TYPE="NUMBER" EMPTYOK="YES" MAXREPEAT=""/>
<FIELD NAME="cig" TYPE="NUMBER" EMPTYOK="YES" MAXREPEAT=""/>
<FIELD NAME="nem" TYPE="NUMBER" EMPTYOK="YES" MAXREPEAT=""/>
<FIELD NAME="ruzgar" TYPE="NUMBER" EMPTYOK="YES" MAXREPEAT=""/>
<FIELD NAME="ruzgaryon" TYPE="NUMBER" EMPTYOK="YES" MAXREPEAT=""/>
<FIELD NAME="basinc" TYPE="NUMBER" EMPTYOK="YES" MAXREPEAT=""/>
<FIELD NAME="sis" TYPE="NUMBER" EMPTYOK="YES" MAXREPEAT=""/>
<FIELD NAME="yagmur" TYPE="NUMBER" EMPTYOK="YES" MAXREPEAT=""/>
<FIELD NAME="kar" TYPE="NUMBER" EMPTYOK="YES" MAXREPEAT=""/>
<FIELD NAME="hail" TYPE="NUMBER" EMPTYOK="YES" MAXREPEAT=""/>
<FIELD NAME="firtina" TYPE="NUMBER" EMPTYOK="YES" MAXREPEAT=""/>
<FIELD NAME="hortum" TYPE="NUMBER" EMPTYOK="YES" MAXREPEAT=""/>
</METADATA>

<RESULTSET FOUND="">

<xsl:for-each select="observation/date/utcdate">
<ROW MODID="" RECORDID="">
<COL><DATA><xsl:value-of select="year"/></DATA></COL>
<COL><DATA><xsl:value-of select="month"/></DATA></COL>
<COL><DATA><xsl:value-of select="mday"/></DATA></COL>
<COL><DATA><xsl:value-of select="hour"/></DATA></COL>
<COL><DATA><xsl:value-of select="min"/></DATA></COL>
<COL><DATA><xsl:value-of select="tempm"/></DATA></COL>
<COL><DATA><xsl:value-of select="dewptm"/></DATA></COL>
<COL><DATA><xsl:value-of select="hum"/></DATA></COL>
<COL><DATA><xsl:value-of select="wspdm"/></DATA></COL>
<COL><DATA><xsl:value-of select="wdird"/></DATA></COL>
<COL><DATA><xsl:value-of select="pressurem"/></DATA></COL>
<COL><DATA><xsl:value-of select="fog"/></DATA></COL>
<COL><DATA><xsl:value-of select="rain"/></DATA></COL>
<COL><DATA><xsl:value-of select="snow"/></DATA></COL>
<COL><DATA><xsl:value-of select="hail"/></DATA></COL>
<COL><DATA><xsl:value-of select="thunder"/></DATA></COL>
<COL><DATA><xsl:value-of select="tornado"/></DATA></COL>
</ROW>
</xsl:for-each>

</RESULTSET>
</FMPXMLRESULT>

</xsl:template>
</xsl:stylesheet>
but the problem is it doesn't give an error but it never imports the data. Can I learn what I am doing wrong.
Thanks.
 

Outcomes