Go Back   Access World Forums > Microsoft Access Discussion > General

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 12-10-2012, 07:25 PM   #1
ddeaton1987
Newly Registered User
 
Join Date: Dec 2012
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
ddeaton1987 is on a distinguished road
XSL Transform only allows Access to import the last XML Value

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.


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>

ddeaton1987 is offline   Reply With Quote
Old 12-11-2012, 06:57 AM   #2
jdraw
Super Moderator
 
jdraw's Avatar
 
Join Date: Jan 2006
Location: Ottawa, Ontario, Canada;West Palm Beach, Florida
Posts: 12,037
Thanks: 78
Thanked 1,995 Times in 1,943 Posts
jdraw is a glorious beacon of light jdraw is a glorious beacon of light jdraw is a glorious beacon of light jdraw is a glorious beacon of light jdraw is a glorious beacon of light
Re: XSL Transform only allows Access to import the last XML Value

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/...d.php?t=212125 for info on posting

Last edited by jdraw; 12-11-2012 at 07:00 AM. Reason: added reference to Bob Larson's <10 post msg.
jdraw is offline   Reply With Quote
Old 12-11-2012, 07:43 AM   #3
ddeaton1987
Newly Registered User
 
Join Date: Dec 2012
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
ddeaton1987 is on a distinguished road
Re: XSL Transform only allows Access to import the last XML Value

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 by ddeaton1987; 12-11-2012 at 08:15 AM.
ddeaton1987 is offline   Reply With Quote
Reply

Tags
import , transform , xml , xsl , xslt

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem importing .XML file into Access 2010 with a .XSL via transform ddeaton1987 General 3 12-09-2012 03:40 PM
Transform Access to Excel Like Pivot manonbar Excel 3 06-30-2010 07:21 AM
Access TRANSFORM (Crosstab) Queries and Missing Rows dugong Queries 7 11-25-2008 10:21 PM
[SOLVED] How to Reverse transform/pivot in Access 2003? straymae Tables 0 10-28-2005 06:43 AM
transform query into sub niki Modules & VBA 2 07-22-2003 10:24 AM




All times are GMT -8. The time now is 02:08 AM.


Microsoft Access Help
General
Tables
Queries
Forms
Reports
Macros
Modules & VBA
Theory & Practice
Access FAQs
Code Repository
Sample Databases
Video Tutorials

Featured Forum post


Sponsored Links


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) copyright 2017 Access World