On 02/28/2017 04:58 PM, Yasser S. wrote:
I have a word doc (attached) with some bold text that becomes <h1> when
I generate XHTML 1.1 (also attached). Is that expected?

Yes. By error, the author of your document gave two normal paragraphs an "Outline level=Level 1". You can check that by right-clicking in any of these two paragraphs and select "Paragraph" from the context menu.

By default, any paragraph, whatever its style (or no style at all) having a outline level other than "Body Text" automatically becomes an XHTML h1, h2, h2, h4, h5, h6 (depending the value of the outline level).

This is done in W2X_install_dir/xed/headings.xed (and also heading-util.xed):

---
for-each /html/body//p[lookup-style("-ms-outlineLvl")] {
    set-variable("level", number(lookup-style("-ms-outlineLvl")));

    set-element-name(concat("h", $level + 1));
    remove-class("^p-Heading\d$");

    unstyleHeading(.);
    ...
}
---



How can I make bold text come out as <b> or <strong> or something like that?

The cleanest and simplest is to use MS-Word to remove "Outline level=Level 1" from these two normal paragraphs.

If you want to automate this, please read carefully read W2X_install_dir/xed/headings.xed and adapt it to the specificities of your DOCX files as explained in the manual http://www.xmlmind.com/w2x/_distrib/doc/manual/index.html

How to do this is out of the scope of normal support to our customers.



The doc also has Heading 1 and Heading 2 styles which correctly become
<h1> and <h2>.

Yes, the two paragraphs having styles "Heading 1" and "Heading 2". These standard styles have respectively "Outline level=Level 1" and "Outline level=Level 2". You can see that in the Paragraph properties of these styles.

--
XMLmind Word To XML Support List
[email protected]
http://www.xmlmind.com/mailman/listinfo/w2x-support

Reply via email to