Welcome to OpenXML Developer Sign in | Join | Help

WordML to (X)HTML, bold, italic, underline problem.

Last post 09-29-2008, 12:54 PM by wowa. 0 replies.
Sort Posts: Previous Next
  •  09-29-2008, 12:54 PM 3744

    WordML to (X)HTML, bold, italic, underline problem.

    Hi!

    I'm writing an xslt script that converts word documents to our company specific xml.
    Pure text formatting should be like in html - <b>, <i>, <u>, etc. So how do this in xsl?

    I have WordML fragment

    <w:p w:rsidR="000D7D59" w:rsidRDefault="00034580">
      <w:r>
        <w:t>ds</w:t>
      </w:r>
      <w:r w:rsidRPr="00034580">
        <w:rPr>
          <w:b/>
        </w:rPr>
        <w:t>aaaa</w:t>
      </w:r>
      <w:r w:rsidRPr="00034580">
        <w:rPr>
          <w:b/>
          <w:i/>
        </w:rPr>
        <w:t>bbb</w:t>
      </w:r>
      <w:r w:rsidRPr="00034580">
        <w:rPr>
          <w:i/>
        </w:rPr>
        <w:t>ggg</w:t>
      </w:r>
      <w:r w:rsidRPr="00034580">
        <w:rPr>
          <w:i/>
          <w:u w:val="single"/>
        </w:rPr>
        <w:t>ccc</w:t>
      </w:r>
    </w:p>

    I'm expecting something like this:
    <b>aaaa<i>bbb</i></b>
    <i>ggg<u>ccc</u></i>

    The biggest problem is tags nesting or crossing.

    Help please :) & sorry for my english.


View as RSS news feed in XML