title: Word Docx mailmerge using xml data and merging using xslt OPENXML
body: <p>I have been searching the net all day to find an answer with no luck; maybe someone has a simple answer for me?</p>
  
  <p>I have created a Word Docx from which I have extracted the word/document.xml to create an xslt file.</p>
  
  <p>I have literally no experience so this is a very steep learning curve so I have been following various examples which I have found and have produced a working 'mailmerge' or transformation using data which is generated from SQLServer as XML.</p>
  
  <p>I now need to do the usual 'mailmerge' stuff like ignoring any blank lines in the address which is printed at the top of the page but I have no idea how I can do this using my xslt file, or any other method for that matter.</p>
  
  <p>Looking at the xslt file, one example of a 'paragraph' which should be ignored is:</p>
  
  <pre><code>          &lt;w:p w:rsidR="0067165E" w:rsidRPr="00F841C2" w:rsidRDefault="0067165E"&gt;
          &lt;w:pPr&gt;
            &lt;w:rPr&gt;
              &lt;w:sz w:val="20"/&gt;
              &lt;w:lang w:val="en-GB"/&gt;
            &lt;/w:rPr&gt;
          &lt;/w:pPr&gt;
          &lt;w:r w:rsidRPr="00F841C2"&gt;
            &lt;w:rPr&gt;
              &lt;w:sz w:val="20"/&gt;
              &lt;w:lang w:val="en-GB"/&gt;
            &lt;/w:rPr&gt;
            &lt;w:t&gt;
              &lt;xsl:value-of select="Address2"/&gt;
            &lt;/w:t&gt;
          &lt;/w:r&gt;
        &lt;/w:p&gt;
  </code></pre>
  
  <p>as I don't want to print a blank line if Address2 is not populated. </p>
  
  <p>From what I have read and the little that I understand (and probably misunderstood), I need to set up functionality to ignore nodes which contain no data (Have I got that much right?)</p>
  
  <p>Can I use this?</p>
  
  <pre><code>&lt;xsl:template match="*[not(child::node())]"/&gt;
  </code></pre>
  
  <p>and how does that interact with the </p>
  
  <pre><code>  &lt;xsl:template match="/"&gt;
  </code></pre>
  
  <p>which I have already put at the top of my xslt file?</p>
  
  <p>If anyone can help me out on this, it would really help to move me along.
  Sorry if it is so simple that I should be able to do it with my eyes closed but I've got to start somewhere!</p>
  
  <p>Thanks</p>