Go Back   Access World Forums > Microsoft Access Discussion > General

 
Reply
 
Thread Tools Rate Thread Display Modes
Old 10-16-2016, 12:38 PM   #1
rasheedkhan
Newly Registered User
 
Join Date: Oct 2016
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
rasheedkhan is on a distinguished road
XML import to access using XSL transform.

Hello,

I have a XML file which, I believe, is attribute-centric. It is a price book file from a POS system. If I import it just using me access, some of the data, such as tax rates, get lost. I wrote an XSL file, my first ever, and I am able to transform data but it only pulls the last element from the XML file in to a table. It seems as if it iterates through all of them and then only copies the last record. Fyi, I am only importing the UPC and Description for testing purposes. In this case, the table will only have the second element and not the first. I have over 4000 elements/records in the file.

Any help will be appreciated.

XML file:

<domain:PLU>
<upc>00012300232838</upc>
<upcModifier>000</upcModifier>
<description>DORAL GREEN</description>
<department>0002</department>
<fee>0</fee>
<pcode>11</pcode>
<price>2.98</price>
<taxRates>
<domain:taxRate sysid="1"/>
</taxRates>
<idChecks>
<domain:idCheck sysid="2"/>
</idChecks>
<SellUnit>1.000</SellUnit>
</domain:PLU>
<domain:PLU>
<upc>00012300000284</upc>
<upcModifier>000</upcModifier>
<description>SALEM SILVER</description>
<department>0004</department>
<fee>0</fee>
<pcode>11</pcode>
<price>5.36</price>
<taxRates>
<domain:taxRate sysid="1"/>
</taxRates>
<idChecks>
<domain:idCheck sysid="2"/>
</idChecks>
<SellUnit>1.000</SellUnit>



XSL file:


<?xml version="1.0" encoding="ISO-8859-1"?>

<xsl:stylesheet version="1.0"
<xslutput method="xml" indent="yes"/>

<xsl:template match="/domain:PLUs">

<PLU>

<xsl:apply-templates select="domain:PLU"/>

<xsl:for-each select="domain:PLU">
<upc>
<xsl:value-of select="/domain:PLUs/domain:PLU/upc"/>
</upc>
<description>
<xsl:value-of select="/domain:PLUs/domain:PLU/description"/>
</description>
</xsl:for-each>



</PLU>


</xsl:template>

</xsl:stylesheet>

rasheedkhan is offline   Reply With Quote
Reply

Tags
import , transform , xml , xsl

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
XSL Transform only allows Access to import the last XML Value ddeaton1987 General 2 12-11-2012 07:43 AM
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




All times are GMT -8. The time now is 03:02 PM.


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