Home > programming > blank page at end of wordML document

blank page at end of wordML document

November 18th, 2008

So I’m doing this XML to wordML conversion using XSLT and there is this annoying blank page at the end of my document.  My code looks like this:

<w:body>
   <wx:sect>
      <w:p>
         <w:pPr>
            <w:sectPr>
               <w:type w:val="continuous"/>
            </w:sectPr>
         </w:pPr>
         <w:r>
            <w:t>section 1</w:t>
         </w:r>
      </w:p>
   </wx:sect>
   <wx:sect>
      <w:p>
         <w:pPr>
            <w:sectPr>
               <w:type w:val="continuous"/>
            </w:sectPr>
         </w:pPr>
         <w:r>
            <w:t>section 2</w:t>
         </w:r>
      </w:p>
   </wx:sect>
</w:body>

However, all you have to do to avoid the blank page is move the section formatting information from inside the last paragraph of the last section to a sibling node next to the last paragraph node.

<w:body>
   <wx:sect>
      <w:p>
         <w:pPr>
            <w:sectPr>
               <w:type w:val="continuous"/>
            </w:sectPr>
         </w:pPr>
         <w:r>
            <w:t>section 1</w:t>
         </w:r>
      </w:p>
   </wx:sect>
   <wx:sect>
      <w:p>
         <w:pPr>
         </w:pPr>
         <w:r>
            <w:t>section 2</w:t>
         </w:r>
      </w:p>
      <w:sectPr>
         <w:type w:val="continuous"/>
      </w:sectPr>
   </wx:sect>
</w:body>

Tada! Blank page gone and your document still has excellent structure.

  • Digg
  • Reddit
  • del.icio.us
  • StumbleUpon
  • Technorati
  • Facebook
  • Google Bookmarks
  • Live

programming , ,

  1. November 18th, 2008 at 20:05 | #1

    Its because you’re creating a wordML doc. What’s up with that? If someone asked me to do it, I’d tell em to fuck off.

  1. No trackbacks yet.