Tables not supported

May 5, 2011 at 11:20 AM

Hi all

I tried this converter and it works well but does not support any tables or borders used in word document.

My opinion is that such a converter is only useful when it supports tables and borders. Why? Because a developer will not have a long time to add texblock elements into a wpf or silverlight page. Instead the time consuming part is layouting the page with the border and table structures. And exactly that should a converter support.

Would be nice if you can extend this converter.

Regards
SkippingAdi

May 12, 2011 at 9:43 AM

Hi,

I had to make a little fix in the WordMLtoWPF.xslt file for my tables where I use content controls in the table cells:

I replaced the template text for "w:tr" with this code:

  <xsl:template match="w:tr">
    <xsl:param name="styleName"/>
    <TableRow>
      <!-- to keep order of table cells-->
      <xsl:choose>
        <xsl:when test="w:tc">
          <xsl:apply-templates>
            <!--select="w:tc"-->
            <xsl:with-param name="styleName" select="$styleName"/>
          </xsl:apply-templates>
        </xsl:when>
        <xsl:when test="w:sdt">
          <!--xsl:for-each select="w:sdt"-->      
          <xsl:for-each select="w:sdtContent">
            <xsl:apply-templates select="w:tc">
              <xsl:with-param name="styleName" select="$styleName"/>
            </xsl:apply-templates>
            <!--/xsl:for-each-->
        </xsl:for-each>
        </xsl:when>
      </xsl:choose>
    </TableRow>
  </xsl:template>
  

You may have a similar issue if you have anything else than plain text in your tables.

Regards, Paal Fr.