rasheedkhan
New member
- Local time
- Yesterday, 22:52
- 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:
<domainLU>
<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>
</domainLU>
<domainLU>
<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="/domainLUs">
<PLU>
<xsl:apply-templates select="domainLU"/>
<xsl:for-each select="domainLU">
<upc>
<xsl:value-of select="/domainLUs/domainLU/upc"/>
</upc>
<description>
<xsl:value-of select="/domainLUs/domainLU/description"/>
</description>
</xsl:for-each>
</PLU>
</xsl:template>
</xsl:stylesheet>
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:
<domainLU>
<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>
</domainLU>
<domainLU>
<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="/domainLUs">
<PLU>
<xsl:apply-templates select="domainLU"/>
<xsl:for-each select="domainLU">
<upc>
<xsl:value-of select="/domainLUs/domainLU/upc"/>
</upc>
<description>
<xsl:value-of select="/domainLUs/domainLU/description"/>
</description>
</xsl:for-each>
</PLU>
</xsl:template>
</xsl:stylesheet>