Ok, thank you! Really appreciate the help, have a good day. Aidan
-----Original Message----- From: Hussein Shafie [mailto:[email protected]] Sent: 04 April 2017 10:55 To: Reilly, Aidan [TYCO GBS - Cork] Cc: [email protected] Subject: Re: [W2X] Word to Dita conversion query On 04/04/2017 10:21 AM, Reilly, Aidan [TYCO GBS - Cork] wrote: > Hi Hussein, > > This still doesn't work for me. See attached for the map_options.txt and > sample file. Am I missing something else? > Well this time, it comes from your DOCX file. Please do not use custom MS-Word styles having names starting with "p-". Use normal style names like "Note" or "Shortdesc". "p-" is prefix automatically added by w2x to make the difference between paragraph styles and character styles ("c-" prefix"). If your custom style name is really called "p-Shortdesc" as you did it, then the style mapping in custom_map_options.txt should be: --- -p edit.blocks.convert "p-Note p class='p-Note' ! p-p-Shortdesc p class='p-p-Shortdesc'" -p transform.shortdesc-class-name p-p-Shortdesc --- which is ugly and not useful. The simplest to rename your custom MS-Word style from "p-Shortdesc" to "Shortdesc". Fixed DOCX attached to this email. Note that the custom style names are normally picked from a list displayed by w2x-app style map wizard. So in principle, there should be no pitfall here. More information in https://urldefense.proofpoint.com/v2/url?u=http-3A__www.xmlmind.com_w2x_-5Fdistrib_doc_w2x-5Fapp-5Fhelp_style-5Fmapping-5Feditor.html&d=DwIC-g&c=0YGvTs3tT-VMy8_v51yLDw&r=kWX-96L-HaqYWQT7R3dtaQioBwcHNohjwVAps7LRdMo&m=OpLuxqk4RWXcjjjKFaK-56CV1zPEfzIITF3ZM5zEqss&s=ulWBTnuGPC20-nV3tWnJjFIbgAU9bP-QDf-WT3RjC0M&e= --- PS: The topic.xslt I sent you is not yet good enough to be used in production. You'll notice that a few of your paragraphs having a "Shortdesc" are removed from the generated DITA topic file. Example: 3 TrueAlert Isolator + Wiring Describes how to wire the 4 TrueAlert Isolator + module. This bug is caused the fact that there is a tab character between "4" and "TrueAlert". If you remove the tabs from these "Shortdesc" paragraphs, it should work OK. This tabs problem is not specific to your use case. It probably causes other style mappings to fail. We'll try to see if this is the case and if it is, fix this as a bug. > Thanks, > > Aidan > > -----Original Message----- > From: Hussein Shafie [mailto:[email protected]] > Sent: 03 April 2017 11:49 > To: Reilly, Aidan [TYCO GBS - Cork] > Cc: [email protected] > Subject: Re: [W2X] Word to Dita conversion query > > 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. >> > > > ________________________________ > > This e-mail contains privileged and confidential information intended for the > use of the addressees named above. If you are not the intended recipient of > this e-mail, you are hereby notified that you must not disseminate, copy or > take any action in respect of any information contained in it. If you have > received this e-mail in error, please notify the sender immediately by e-mail > and immediately destroy this e-mail and its attachments. > > > > > -- > XMLmind Word To XML Support List > [email protected] > https://urldefense.proofpoint.com/v2/url?u=http-3A__www.xmlmind.com_ma > ilman_listinfo_w2x-2Dsupport&d=DwIC-g&c=0YGvTs3tT-VMy8_v51yLDw&r=kWX-9 > 6L-HaqYWQT7R3dtaQioBwcHNohjwVAps7LRdMo&m=OpLuxqk4RWXcjjjKFaK-56CV1zPEf > zIITF3ZM5zEqss&s=fUMMkvHXR4AWbyc0CqH_lzGKSB5kTSyx_HzrJRK-cAU&e= > ________________________________ This e-mail contains privileged and confidential information intended for the use of the addressees named above. If you are not the intended recipient of this e-mail, you are hereby notified that you must not disseminate, copy or take any action in respect of any information contained in it. If you have received this e-mail in error, please notify the sender immediately by e-mail and immediately destroy this e-mail and its attachments. -- XMLmind Word To XML Support List [email protected] http://www.xmlmind.com/mailman/listinfo/w2x-support
