Question XML import to access using XSL transform. (1 Viewer)

rasheedkhan

New member
Joined
Oct 16, 2016
Messages
2
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"
<xsl:eek:utput 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>
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top Bottom