Please find the answers to your questions below.
On 07/15/2016 11:43 PM, Moore, Ray A wrote:
Someone in one of the meeting here at Intel ask about getting the
following changes done. First I what to ask what is the risks of making
the changes only for the increase in their efficiency?
None. XMLmind Word To XML is really designed to automate the conversion
of DOCX to XML and hence minimize the need to correct by hand the
generated XML files.
How many modules
would be effect both in XED and XLST?
Difficult to answer this question. There are customizations easier to
implement in XED and other easier to implement in XSLT. This also
depends on your proficiency in XED and in XSLT.
My answers below assume that you'll prefer to do it using a custom XSLT
stylesheet.
Would there changes effects any upgrades releases in the future.
No because XMLmind Word To XML is really designed to be extensively
customized by its users.
Should they be happy with the current
system and don’t worry so much about efficiency as along as they have a
clean conversiojn?
I strongly encourage you to customize the conversion process. What you
want is not difficult to achieve.
Thanks in Advance for any input.
Background: The stylesheets for OSA/IPIX work very well. Some of the
settings that are brought through by the conversion script are blocking
the stylesheets and should not be converted. My team is manually
correcting the files after the conversion, but it would increase our
efficiency to let the converter to do the corrections.
FWIW, OSA uses only simple topics (I don’t know if other teams use it
for other topic types).
Table settings
• Remove table width (pgwide attribute for the table element)
• Remove column width (colwidth attribute for the colspec element)
• Remove all vertical alignment settings (valign attribute for entry,
row, and tbody)
Figure/image settings
• Remove expanse attribute for fig element (if it’s currently
included—I’m not sure about this one)
• Image size…
For OSA conversions, we’d like all of the image settings to be cleared
and assigned standard attributes:
width=”385pt”
placement=”break”
Do not set a horizontal alignment attribute
I think this attribute assignment needs more discussion, though. I don’t
know how other groups in Intel are using the converter, and those who
are not converting for OSA may not want these settings, particularly the
width, which is set for PDFs. Perhaps it would be possible to create a
destination XLST file type specifically for OSA simple topics?
Sure. It's very easy.
I think that all the above requirements could be easy to implement using
a custom XSLT stylesheet.
1) Create a custom XSLT 1.0 stylesheet using the following template:
---
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:h="http://www.w3.org/1999/xhtml"
exclude-result-prefixes="h">
<xsl:import href="w2x:xslt/topic.xslt"/>
</xsl:stylesheet>
---
Let's call this custom XSLT 1.0 stylesheet "osa.xslt".
2) Add custom <xsl:template>s to it. You'll have to read stock
<w2x_install_dir>/xslt/topic.xslt and <w2x_install_dir>/xslt/tgroup.xslt
to find out which <xsl:template>s to override in "osa.xslt".
3) Run w2x as follows:
w2x -o topic ...extra options... -t osa.xslt IN.docx OUT.dita
to replace stock topic.xslt by custom osa.xslt.
See "-t xslt_URL_or_file" in "7 The w2x command-line utility",
http://www.xmlmind.com/w2x/_distrib/doc/manual/index.html#w2x_command
Cross references
Would it be possible to bring in the xrefs with descriptive text? Here’s
an example of what we need in the final code:
<xref href="GUID-3DD49FD5-B64A-4F10-9611-B2F39BE10C56" format="dita"
type="simpletopic" scope="local"> <?xm-replace_text Pin
List Ball Map ?>
</xref>
It would be really helpful if xrefs could be brought in with the
xm-replace_text tag that uses the text that was originally used to make
the link in the Word file—in this case it was Pin List Ball Map.
The link text originally used in the DOCX file is found in the "title"
attribute of the XHTML <a> element generated during the Edit step.
(FYI, this Edit step running <w2x_install_dir>/xed/main.xed converts
styled XHTML to semantic XHTML; after that, a Transform step normally
running <w2x_install_dir>/xslt/topic.xslt converts semantic XHTML to a
DITA topic.)
Example of <a> created by <w2x_install_dir>/xed/main.xed itself invoking
xrefs.xed:
---
<a class="role-xref" href="GUID-3DD49FD5-B64A-4F10-9611-B2F39BE10C56"
title="Pin List Ball Map"/>
---
Your custom XSLT stylesheet could very easily convert the above <a> to
the DITA <xref> you want.
[Edit made 5/18/16: removed image setting request for align="center" and
said alignment should not be set at all.
--
XMLmind Word To XML Support List
w2x-support@xmlmind.com
http://www.xmlmind.com/mailman/listinfo/w2x-support