This is perfect! Thank you. Sorry, this got shuffled into my SPAM folder and 
went unnoticed for a couple of days.

-Wayne

——————————

Wayne Brissette
Tools and Methodology Specialist | PEG
 P: +1 512 732 8144    |      M: +1 512 577 5570
 I: 18135

5707 Southwest Parkway
Building 1, Suite 100
Austin, TX 78735
www.arm.com<http://www.arm.com>

On Apr 13, 2018, at 03:06, Hussein Shafie 
<huss...@xmlmind.com<mailto:huss...@xmlmind.com>> wrote:

On 04/12/2018 06:01 PM, Wayne Brissette wrote:
I’m trying to determine if there’s a way to specify alternative elements
for inline formatting such as bold <b> or italics <I> in WordtoXML. They
don’t show up in the character options, but then those aren’t characters
specified in the Word document, typically they are simply set in Word by
authors and applied ad hoc.


There is currently no easy way to do this.



1) If you are talking about XHTML <b> and <i>, you'll have to modify (or 
replace) W2X_install_dir/xed/inlines.xed. Excerpts:

---
       } elseif get-style("font-weight") = "bold" {
           set-element-name("b");
           set-style("font-weight");

           convertCommonTextStyles($generateBigSmall);
       } elseif get-style("font-style") = "italic" {
           set-element-name("i");
           set-style("font-style");

           convertCommonTextStyles($generateBigSmall);
       }
---

Suffice to replace set-element-name("b") by something like 
set-element-name("strong"), set-element-name("i") by set-element-name("em"), 
etc.



2) Now if you are talking about DITA <b> and <i>, you'll have to modify (or 
replace) W2X_install_dir/xslt/topic.xslt. Excerpts:

---
<xsl:template match="h:cite |
                    h:b |
                    h:i |
                    h:li |
                    h:q |
                    h:sub |
                    h:sup |
                    h:tt |
                    h:u">
 <xsl:element name="{local-name()}">
   <xsl:call-template name="processCommonAttributes"/>
   <xsl:apply-templates/>
 </xsl:element>
</xsl:template>
---

Suggested new templates:

---
<!-- Removed h:b|h:i here. -->
<xsl:template match="h:cite |
                    h:li |
                    h:q |
                    h:sub |
                    h:sup |
                    h:tt |
                    h:u">
 <xsl:element name="{local-name()}">
   <xsl:call-template name="processCommonAttributes"/>
   <xsl:apply-templates/>
 </xsl:element>
</xsl:template>

<xsl:template match="h:b">
 <xsl:element name="WHATEVER_YOU_WANT_SIMILAR_TO_B">
   <xsl:call-template name="processCommonAttributes"/>
   <xsl:apply-templates/>
 </xsl:element>
</xsl:template>

<xsl:template match="h:i">
 <xsl:element name="WHATEVER_YOU_WANT_SIMILAR_TO_I">
   <xsl:call-template name="processCommonAttributes"/>
   <xsl:apply-templates/>
 </xsl:element>
</xsl:template>
---



--> If you are interested in (1), we could add *easy-to-use* *parameters* for 
use in set-element-name("b"), set-element-name("i"), etc, in next version of 
Word To XML. Simply confirm that you are interested in this RFE.






IMPORTANT NOTICE: The contents of this email and any attachments are 
confidential and may also be privileged. If you are not the intended recipient, 
please notify the sender immediately and do not disclose the contents to any 
other person, use it for any purpose, or store or copy the information in any 
medium. Thank you.
--
XMLmind Word To XML Support List
w2x-support@xmlmind.com
http://www.xmlmind.com/mailman/listinfo/w2x-support

Reply via email to