codegirl.blog(this);

Christina A. Odom — Developing SharePoint Solutions

MOSS Document Conversion not working for your documents? Do they have attached XML schemas?

Posted on January 22, 2009 - Filed Under Life

Senerio:  You have a nice .docx that you want to use MOSS Document Conversions on to convert a .docx to a web page.  You hit convert and the resulting page has nothing on it.  You take out all the fancy stuff and try the same sequence with a regular “hello world” document.  Works fine.  Try again with a “Hello World” with images.. no images (I’ll come back to that).  Try it a third time, attaching a xml schema to the document and surround Hello in your document with your custom schema and leave World alone.  Only World renders.

For the Images, Check out TheKid’s very excellent article on making a custom handler for document previews.  He gets around the lack of embedded images.

If you are still having problems with your document now rendering and you have custom XML markup in your document, add this line to your c:\\temp\\DocX2Html.xsl when trying out TheKid’s solution.

  <xsl:template match=w:customXml >
    <
xsl:apply-templates select=*/>
  xsl:template>

This will ignore any w:customXml tags in your document (how Microsoft says “this part belongs to this custom schema located somewhere else) and render things nicely. 

Just don’t be an idiot and modify the original .xsl.

Comments

One Response to “MOSS Document Conversion not working for your documents? Do they have attached XML schemas?”

  1. More additions on the docx -> html topic: Shapes & things. : codegirl.blog(this); on June 4th, 2009 12:49 pm

    [...] Rothwell’s article on Creating a docx -> Html Preview Handler for SharePoint and about how to render customxml nodes, so this is just further expansion on the coolness of this [...]

Leave a Reply

You must be logged in to post a comment.