On 04/03/2017 11:23 AM, Reilly, Aidan [TYCO GBS - Cork] wrote:
Hi Hussein,

Thanks for the below. This doesn't work for me however. Attached is a sample 
document and the options file. I deleted the jar and copied the xsl file as you 
suggest. Am I missing something else?


Please add by hand:

-p transform.shortdesc-class-name p-Shortdesc

to your w2x options file custom_map_toptions.txt *after* using the w2x-app wizard to map MS-Word paragraph style p-Shortdesc to DITA shortdesc.

The custom_map_toptions.txt you attached to your email shows that you just mapped MS-Word paragraph style p-Note to DITA note.

The p-Shortdesc style mapping step is still required; "-p transform.shortdesc-class-name p-Shortdesc" just fixes the fact that the DITA shortdesc was generated inside the topic body.




Thanks, Aidan

-----Original Message-----
From: Hussein Shafie [mailto:[email protected]]
Sent: 01 April 2017 11:03
To: Reilly, Aidan [TYCO GBS - Cork]
Cc: [email protected]
Subject: Re: [W2X] Word to Dita conversion query

On 03/30/2017 10:46 AM, Reilly, Aidan [TYCO GBS - Cork] wrote:

I hope you are well. Can you tell me if there is an easy way to allow
for shortdesc markup in the word file that gets converted correctly at
build time? The problem is, if I tag something as <shortdesc> it
produces an invalid xml file because the shortdesc is put inside the
</conbody> element, not before.


This can be done as follows:

1) Delete W2X_install_dir/lib/w2x_all.jar because this self-contained JAR file 
contains a copy of subdirectories xed/ and xslt/ and would get in the way.

2) Rename W2X_install_dir/xslt/topic.xslt to topic.xslt.ORI and copy attached 
topic.xslt to W2X_install_dir/xslt/

3) Edit your w2x options file using a text editor and add this line:
---
-p transform.shortdesc-class-name p-Shortdesc
---

This extra parameter is *really* *really* required by attached, modified 
topic.xslt for the feature you have requested to work.

As you have guessed it, this parameter is used to specify the class name of the XHTML 
<p> which acts as a short description of the section. Other
example: "-p transform.shortdesc-class-name p-Abstract".

The default value of the parameter is the empty string, which disables the 
feature you have requested.

Now your w2x options file contains something like:
---
-o map
-p transform.topic-type concept
-p transform.shortdesc-class-name p-Shortdesc -p transform2.section-depth 4 -p 
transform2.topic-path %{~nO}/ -p edit.blocks.convert "p-Note p class='p-Note' ! 
p-Shortdesc p class='p-Shortdesc'"
-t custom_map_options_scripts/custom_transform.xslt
---



--> Note that we are not yet 100% sure to keep this feature in the next
version of W2X. We don't think that your use case is that common. I
mean, authors using MS-Word rarely bother writing short descriptions of
the document sections they create.

Anyway, we wanted to help you and also we wanted to see if the feature
you have requested (which certainly makes sense) was technically
possible. It was possible, but somewhat technically challenging to
implement.



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

Reply via email to