XSL Transform only allows Access to import the last XML Value

ddeaton1987

New member
Local time
Yesterday, 22:34
Joined
Dec 9, 2012
Messages
6
I'm trying to import an XML file into my access database using an XSL Transform (I only need certain bits of data), however when I import the tables and field names come through fine now but the only values that come through are the last values listed in the XML file... for instance when i import high there would be 10 high values but only the last one comes through. Additionally if anyone knows a way to import this data as more than just text into a table please help me out. I would obviously like the "Day" field to be a date/time field in access, and the high and low to be a number field in access... but this is back-burner to solving the real issue listed up top.:banghead:


This is my XSL file:
Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="Transform Link (I don't have 10 posts yet and can't post links)">

<xsl:template match="/">

  <Weather>

        <xsl:for-each select="response/forecast/simpleforecast/forecastdays/forecastday">

        <High><xsl:value-of select="high/fahrenheit"/></High>

        <Low><xsl:value-of select="low/fahrenheit"/></Low>

        <Day><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"/></Day>
        
        </xsl:for-each>

  </Weather>

</xsl:template>
</xsl:stylesheet>
 
Why not show us the code you have tried?
Are you getting error messages?
We can't help you or offer meaningful advice until we understand your situation.
And the best way to do that is for you to show us exactly what you have tried and related pertinent info.


see http://www.access-programmers.co.uk/forums/showthread.php?t=212125 for info on posting
 
Last edited:
I posted this in my first post, are you asking for something else??? I'm not receiving any error messages either. This is what I have so far:
Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="g/1999/XSL/Transform">

<xsl:template match="/">

  <Weather>

        <xsl:for-each select="response/forecast/simpleforecast/forecastdays/forecastday">

        <High><xsl:value-of select="high/fahrenheit"/></High>

        <Low><xsl:value-of select="low/fahrenheit"/></Low>

        <Day><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"/></Day>
        
        </xsl:for-each>

  </Weather>

</xsl:template>
</xsl:stylesheet>
 
Last edited:

Users who are viewing this thread

Back
Top Bottom