Problem importing .XML file into Access 2010 with a .XSL via transform

ddeaton1987

New member
Local time
Today, 01:13
Joined
Dec 9, 2012
Messages
6
I'm having difficulty getting my import to work... when i call on the original XML file I get too many tables... when i call on the XML file using the transform function of Access with the XSL file it gives me only two tables "body" and "tr". Body contains the value "Weather" and tr contains the value "Day". I know there's a problem with my XSL file but I can't figure out what it is... I hope to accomplish is the following:

Import the day as month/day/year into a field "Day" in access table "WeatherSFCAL"
Import the Fahrenheit temp from the high section into the field "High" in access table "WeatherSFCAL"
Import the Fahrenheit temp from the low section into the field "Low" in access table "WeatherSFCAL"

It would not let me upload these files so I'll paste the data in two posts below:
 
XML File:
Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl=""i can't post links w3 org/1999/XSL/Transform">

<xsl:template match="/">
  <html>
  <body>
  <h2>Weather</h2>
    <table border="1">
      <tr bgcolor="#9acd32">
        <th>High</th>
        <th>Low</th>
        <th>Day</th>
      </tr>
      <xsl:for-each select="response/forecast/simpleforecast/forecastdays/forecastday">
      <tr>
        <td><xsl:value-of select="high/fahrenheit"/></td>
        <td><xsl:value-of select="low/fahrenheit"/></td>
        <td><xsl:value-of select="date/month"/>
        <xsl:text>/</xsl:text>
        <xsl:value-of select="date/day"/>
        <xsl:text>/</xsl:text>
        <xsl:value-of select="date/year"/></td>
      </tr>
      </xsl:for-each>
    </table>
  </body>
  </html>
</xsl:template>
</xsl:stylesheet>
 
First part of XML File:
Code:
<response>
    <version>0.1</version>
    <termsofService>link blah blah blah</termsofService>
    <features>
        <feature>forecast10day</feature>
    </features>
    <forecast>
        <txt_forecast>
        <date>1:00 PM PST</date>
        <forecastdays>
        <forecastday>
        <period>0</period>
        <icon>rain</icon>
        <icon_url>cons-ak.wxug.com/i/c/k/rain.gif</icon_url>
        <title>Tuesday</title>
        <fcttext><![CDATA[Mostly cloudy with a chance of rain, then  rain in the afternoon. High of 63F. Winds from the South at 5 to 10 mph. Chance of rain 70%.]]></fcttext>
        <fcttext_metric><![CDATA[Mostly cloudy with a chance of rain, then  rain in the afternoon. High of 17C. Winds from the South at 5 to 15 km/h. Chance of rain 70%.]]></fcttext_metric>
        <pop>70</pop>
        </forecastday>
        <forecastday>
        <period>1</period>
        <icon>rain</icon>
        <icon_url>k.wxug.com/i/c/k/rain.gif</icon_url>
        <title>Tuesday Night</title>
        <fcttext><![CDATA[Mostly cloudy with rain. Low of 55F. Winds from the South at 5 to 15 mph. Chance of rain 80% with rainfall amounts near 0.2 in. possible.]]></fcttext>
        <fcttext_metric><![CDATA[Mostly cloudy with rain. Low of 13C. Breezy. Winds from the South at 10 to 25 km/h. Chance of rain 80% with rainfall amounts near 5.8 mm possible.]]></fcttext_metric>
        <pop>80</pop>
        </forecastday>
        <forecastday>
        <period>2</period>
        <icon>rain</icon>
        <icon_url>cons-ak.wxug.com/i/c/k/rain.gif</icon_url>
        <title>Wednesday</title>
        <fcttext><![CDATA[Mostly cloudy with rain, then  rain showers in the afternoon. High of 64F. Breezy. Winds from the SSW at 10 to 20 mph. Chance of rain 80%.]]></fcttext>
        <fcttext_metric><![CDATA[Mostly cloudy with rain, then  rain showers in the afternoon. High of 18C. Breezy. Winds from the SSW at 15 to 25 km/h. Chance of rain 80%.]]></fcttext_metric>
        <pop>80</pop>
        </forecastday>
        <forecastday>
        <period>3</period>
        <icon>partlycloudy</icon>
        <icon_url>ns-ak.wxug.com/i/c/k/partlycloudy.gif</icon_url>
        <title>Wednesday Night</title>
        <fcttext><![CDATA[Partly cloudy with a chance of rain. Low of 54F. Winds from the West at 5 to 10 mph. Chance of rain 20%.]]></fcttext>
        <fcttext_metric><![CDATA[Partly cloudy with a chance of rain. Low of 12C. Winds from the West at 5 to 15 km/h.]]></fcttext_metric>
        <pop>20</pop>
        </forecastday>
        <forecastday>
        <period>4</period>
        <icon>partlycloudy</icon>
        <icon_url>com/i/c/k/partlycloudy.gif</icon_url>
        <title>Thursday</title>
        <fcttext><![CDATA[Partly cloudy. High of 59F. Breezy. Winds from the WNW at 10 to 20 mph.]]></fcttext>
        <fcttext_metric><![CDATA[Partly cloudy. High of 15C. Windy. Winds from the WNW at 15 to 30 km/h.]]></fcttext_metric>
        <pop>10</pop>
        </forecastday>
        <forecastday>
        <period>5</period>
        <icon>partlycloudy</icon>
        <icon_url>com/i/c/k/partlycloudy.gif</icon_url>
        <title>Thursday Night</title>
        <fcttext><![CDATA[Partly cloudy in the evening, then clear. Low of 48F. Breezy. Winds from the NW at 10 to 20 mph.]]></fcttext>
        <fcttext_metric><![CDATA[Partly cloudy in the evening, then clear. Low of 9C. Breezy. Winds from the NW at 20 to 25 km/h.]]></fcttext_metric>
        <pop>0</pop>
        </forecastday>
        <forecastday>
        <period>6</period>
        <icon>partlycloudy</icon>
        <icon_url>k/partlycloudy.gif</icon_url>
        <title>Friday</title>
        <fcttext><![CDATA[Partly cloudy. High of 61F. Winds from the NNW at 10 to 15 mph.]]></fcttext>
        <fcttext_metric><![CDATA[Partly cloudy. High of 16C. Breezy. Winds from the NNW at 20 to 25 km/h.]]></fcttext_metric>
        <pop>0</pop>
        </forecastday>
        <forecastday>
        <period>7</period>
        <icon>partlycloudy</icon>
        <icon_url>wxug.com/i/c/k/partlycloudy.gif</icon_url>
        <title>Friday Night</title>
        <fcttext><![CDATA[Partly cloudy. Low of 48F. Breezy. Winds from the NNW at 10 to 20 mph.]]></fcttext>
        <fcttext_metric><![CDATA[Partly cloudy. Low of 9C. Breezy. Winds from the NNW at 15 to 25 km/h.]]></fcttext_metric>
        <pop>0</pop>
        </forecastday>
        <forecastday>
        <period>8</period>
        <icon>partlycloudy</icon>
        <icon_url>s-ak.wxug.com/i/c/k/partlycloudy.gif</icon_url>
        <title>Saturday</title>
        <fcttext><![CDATA[Clear in the morning, then partly cloudy. High of 61F. Winds from the NNW at 10 to 15 mph.]]></fcttext>
        <fcttext_metric><![CDATA[Clear in the morning, then partly cloudy. High of 16C. Breezy. Winds from the NNW at 15 to 20 km/h.]]></fcttext_metric>
        <pop>0</pop>
        </forecastday>
        <forecastday>
        <period>9</period>
        <icon>partlycloudy</icon>
        <icon_url>com/i/c/k/partlycloudy.gif</icon_url>
        <title>Saturday Night</title>
        <fcttext><![CDATA[Partly cloudy. Low of 45F. Breezy. Winds from the NNE at 10 to 20 mph.]]></fcttext>
        <fcttext_metric><![CDATA[Partly cloudy. Low of 7C. Windy. Winds from the NNE at 20 to 30 km/h.]]></fcttext_metric>
        <pop>0</pop>
        </forecastday>
        <forecastday>
        <period>10</period>
        <icon>partlycloudy</icon>
        <icon_url>htm/i/c/k/partlycloudy.gif</icon_url>
        <title>Sunday</title>
        <fcttext><![CDATA[Partly cloudy. High of 61F. Winds from the NE at 10 to 15 mph.]]></fcttext>
        <fcttext_metric><![CDATA[Partly cloudy. High of 16C. Breezy. Winds from the NE at 15 to 20 km/h.]]></fcttext_metric>
        <pop>0</pop>
 
This XML File is way too large to post here unfortunately and would require 3 separate posts. Please let me know if you require it to diagnose the problem... the XML file is pointing to the correct locations in the file to get the info, it's just not importing correctly.,
 

Users who are viewing this thread

Back
Top Bottom