title: XSL Taking XML transforming it into Excel
body: <p>New guy here so bear with me. Ive got a basic XSL file that will read my xml data. Im trying to put xml into Excel.  Heres my issue. With a small XML file it seems to convert it easly, BUT with this XML file that had several nodes ( I think they are called), when I call up the data, its not right. I want to only show info from the check portion of XML and then show it in Excel in a way that shows the 6 or 7 columns that I want, then show the data. Heres what I have so far: </p>
  
  <p>XML:</p>
  
  <pre><code>&lt;bdiData&gt;
    &lt;documentControlInfo&gt;
      &lt;documentInfo&gt;
        &lt;docDescription&gt;Checks for Company X&lt;/docDescription&gt;
        &lt;docID&gt;
          &lt;ID&gt;123456789&lt;/ID&gt;
        &lt;/docID&gt;
        &lt;docModifier&gt;My Company&lt;/docModifier&gt;
        &lt;docCreateDate&gt;2010-08-23&lt;/docCreateDate&gt;
        &lt;docCreateTime&gt;07:08:54-0700&lt;/docCreateTime&gt;
        &lt;standardVersion&gt;1.0&lt;/standardVersion&gt;
        &lt;testIndicator&gt;0&lt;/testIndicator&gt;
        &lt;resendIndicator&gt;0&lt;/resendIndicator&gt;
      &lt;/documentInfo&gt;
      &lt;sourceInfo&gt;
        &lt;sourceName&gt;My Banking Name&lt;/sourceName&gt;
        &lt;sourceID&gt;
          &lt;idOther&gt;ShortBankName&lt;/idOther&gt;
        &lt;/sourceID&gt;
      &lt;/sourceInfo&gt;
      &lt;destinationInfo&gt;
        &lt;destinationName&gt;My Company&lt;/destinationName&gt;
        &lt;destinationID&gt;
          &lt;idOther&gt;MYCO&lt;/idOther&gt;
        &lt;/destinationID&gt;
      &lt;/destinationInfo&gt;
    &lt;/documentControlInfo&gt;
    &lt;checkItemCollection&gt;
      &lt;collectionInfo&gt;
        &lt;description&gt;Items&lt;/description&gt;
        &lt;ID&gt;654811650&lt;/ID&gt;
        &lt;Classification&gt;
          &lt;classification&gt;Items&lt;/classification&gt;
        &lt;/Classification&gt;
      &lt;/collectionInfo&gt;
      &lt;checkItemBatch&gt;
        &lt;checkItemBatchInfo&gt;
          &lt;description&gt;Paid Checks&lt;/description&gt;
          &lt;ID&gt;1239668334710&lt;/ID&gt;
          &lt;Classification&gt;
            &lt;classification&gt;Paid Checks&lt;/classification&gt;
          &lt;/Classification&gt;
        &lt;/checkItemBatchInfo&gt;
        &lt;checkItem&gt;
          &lt;checkItemType&gt;check&lt;/checkItemType&gt;
          &lt;checkAmount&gt;2960&lt;/checkAmount&gt;
          &lt;postingInfo&gt;
            &lt;date&gt;2009-06-12&lt;/date&gt;
            &lt;RT&gt;87654321&lt;/RT&gt;
            &lt;accountNumber&gt;123465798&lt;/accountNumber&gt;
            &lt;seqNum&gt;007725552898&lt;/seqNum&gt;
            &lt;trancode&gt;001152&lt;/trancode&gt;
            &lt;amount&gt;2960&lt;/amount&gt;
            &lt;serialNumber&gt;55225410&lt;/serialNumber&gt;
          &lt;/postingInfo&gt;
  </code></pre>
  
  <p>XSL File:</p>
  
  <pre><code>&lt;xsl:stylesheet version="1.0"
      xmlns="urn:schemas-microsoft-com:office:spreadsheet"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   xmlns:msxsl="urn:schemas-microsoft-com:xslt"
   xmlns:user="urn:my-scripts"
   xmlns:o="urn:schemas-microsoft-com:office:office"
   xmlns:x="urn:schemas-microsoft-com:office:excel"
   xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" &gt;
  
    &lt;xsl:template match="/"&gt;
      &lt;Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
        xmlns:o="urn:schemas-microsoft-com:office:office"
        xmlns:x="urn:schemas-microsoft-com:office:excel"
        xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
        xmlns:html="http://www.w3.org/TR/REC-html40"&gt;
        &lt;xsl:apply-templates/&gt;
      &lt;/Workbook&gt;
    &lt;/xsl:template&gt;
  
  
    &lt;xsl:template match="/*"&gt;
      &lt;Worksheet&gt;
        &lt;xsl:attribute name="ss:Name"&gt;
          &lt;xsl:value-of select="local-name(/*/*)"/&gt;
        &lt;/xsl:attribute&gt;
        &lt;Table x:FullColumns="1" x:FullRows="1"&gt;
          &lt;Row&gt;
  
            &lt;xsl:for-each select="*[position() = 2]/*/checkItem/postingInfo/*"&gt;
  
              &lt;Cell&gt;
                &lt;Data ss:Type="String"&gt;
                  &lt;xsl:value-of select="local-name()"/&gt;
                &lt;/Data&gt;
              &lt;/Cell&gt;
            &lt;/xsl:for-each&gt;
          &lt;/Row&gt;
          &lt;xsl:apply-templates/&gt;
        &lt;/Table&gt;
      &lt;/Worksheet&gt;
    &lt;/xsl:template&gt;
  
  
    &lt;xsl:template match="/*/checkItem/postingInfo/*"&gt;
      &lt;Row&gt;
        &lt;xsl:apply-templates/&gt;
      &lt;/Row&gt;
    &lt;/xsl:template&gt;
  
  
    &lt;xsl:template match="/*/checkItem/postingInfo/*"&gt;
      &lt;Cell&gt;
        &lt;Data ss:Type="String"&gt;
          &lt;xsl:value-of select="."/&gt;
        &lt;/Data&gt;
      &lt;/Cell&gt;
    &lt;/xsl:template&gt;
  
  
  &lt;/xsl:stylesheet&gt;
  </code></pre>
  
  <p>Does anyone have any Idea how I can get to JUSt the check portion f the XML file and have it format in an eay way??</p>
  
  <p>Thanks</p>
  
  <p>GabrielVA</p>