title: Access Using XSLT to import XML
body: <p>I'm currently working on new code on Access that I can't seem to wrap my head around. I'm very new to xslt and I understand the basic concepts of "For-Each" but I am still having trouble with it. I was hoping if some of you guys can help me understand why my code isn't working how it is suppose to. </p>
  
  <p>What I was hoping for is to print all of this in tables in Access with having all Branch names in separate rows. Currently I have the branch names printed in a single row.</p>
  
  <p>Anything helps. Thank you guys!</p>
  
  <p>XSLT Code</p>
  
  <pre><code>&lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt;
  &lt;xsl:output method="xml" indent="yes"/&gt;
  &lt;xsl:template match="/"&gt;
  &lt;ING_PNA_Import&gt;
    &lt;xsl:for-each select="PNAResponse/PriceAndAvailability"&gt;
      &lt;Import&gt;
  
        &lt;Test&gt;
          &lt;SKU&gt;
            &lt;xsl:value-of select="@SKU"/&gt;
          &lt;/SKU&gt;
          &lt;VendorNumber&gt;
            &lt;xsl:value-of select="VendorNumber"/&gt;
          &lt;/VendorNumber&gt;
          &lt;Price&gt;
            &lt;xsl:value-of select="Price"/&gt;
          &lt;/Price&gt;
          &lt;MPN&gt;
            &lt;xsl:value-of select="ManufacturerPartNumber"/&gt;
          &lt;/MPN&gt;
  
            &lt;ID&gt;
              &lt;xsl:value-of select="Branch/@ID"/&gt;
              &lt;xsl:text&gt;
              &lt;/xsl:text&gt;
          &lt;/ID&gt;
  
          &lt;Name&gt;
  
            &lt;xsl:for-each select="Branch"&gt;
              &lt;xsl:value-of select="@Name"/&gt;
            &lt;/xsl:for-each&gt;`
          &lt;/Name&gt;
  
          &lt;Availability&gt;
            &lt;xsl:value-of select="Branch/Availability"/&gt;
          &lt;/Availability&gt;
  
        &lt;/Test&gt;
  
      &lt;/Import&gt;
    &lt;/xsl:for-each&gt;
  &lt;/ING_PNA_Import&gt;
  </code></pre>
  
  <p>
  </p>
  
  <p>XML Code:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="iso-8859-1"?&gt;
  &lt;PNAResponse&gt;
  &lt;Version&gt;2.0&lt;/Version&gt;
  &lt;TransactionHeader&gt;
    &lt;SenderID&gt;YOU&lt;/SenderID&gt;
    &lt;ReceiverID&gt;MD&lt;/ReceiverID&gt;
    &lt;ErrorStatus ErrorNumber=""&gt;&lt;/ErrorStatus&gt;
    &lt;DocumentID&gt;&lt;/DocumentID&gt;
    &lt;TransactionID&gt;&lt;/TransactionID&gt;
  &lt;/TransactionHeader&gt;
  
  &lt;PriceAndAvailability SKU="100150" Quantity="1"&gt;
    &lt;Price&gt;21.21&lt;/Price&gt;
    &lt;SpecialPriceFlag&gt;&lt;/SpecialPriceFlag&gt;
    &lt;ManufacturerPartNumber&gt;TEST1234&lt;/ManufacturerPartNumber&gt;
    &lt;ManufacturerPartNumberOccurs&gt;&lt;/ManufacturerPartNumberOccurs&gt;
    &lt;VendorNumber&gt;123X&lt;/VendorNumber&gt;
    &lt;Description&gt;Cool Item&lt;/Description&gt;
    &lt;ReserveInventoryFlag&gt;Y&lt;/ReserveInventoryFlag&gt;
    &lt;AvailableRebQty&gt;0&lt;/AvailableRebQty&gt;
  
    &lt;Branch Name="Town1" ID="01"&gt;
      &lt;Availability&gt;8&lt;/Availability&gt;
      &lt;OnOrder&gt;0&lt;/OnOrder&gt;
      &lt;ETADate&gt;&lt;/ETADate&gt;
    &lt;/Branch&gt;
  
    &lt;Branch Name="Town2" ID="02"&gt;
      &lt;Availability&gt;8&lt;/Availability&gt;
      &lt;OnOrder&gt;0&lt;/OnOrder&gt;
      &lt;ETADate&gt;&lt;/ETADate&gt;
    &lt;/Branch&gt;
  
    &lt;Branch Name="Town3" ID="03"&gt;
      &lt;Availability&gt;6&lt;/Availability&gt;
      &lt;OnOrder&gt;5&lt;/OnOrder&gt;
      &lt;ETADate&gt;&lt;/ETADate&gt;
    &lt;/Branch&gt;
  
    &lt;Branch Name="Town4" ID="04"&gt;
      &lt;Availability&gt;5&lt;/Availability&gt;
      &lt;OnOrder&gt;5&lt;/OnOrder&gt;
      &lt;ETADate&gt;&lt;/ETADate&gt;
    &lt;/Branch&gt;
  
    &lt;Branch Name="Town5" ID="05"&gt;
      &lt;Availability&gt;10&lt;/Availability&gt;
      &lt;OnOrder&gt;0&lt;/OnOrder&gt;
      &lt;ETADate&gt;&lt;/ETADate&gt;
    &lt;/Branch&gt;
  
    &lt;UPC&gt;123456789012345&lt;/UPC&gt;
    &lt;CustomerPartNumber&gt;&lt;/CustomerPartNumber&gt;
  </code></pre>
  
  <p>
     </p>