On 05/01/2015 07:19 PM, Jeff Hooker wrote:
I've been testing the w2x beta and overall its accuracy is beautiful.
If the only point of this tool is to convert Word into XML *so that it can be
published in alternative ways* then it's fine.
Yes, this is probably the most common use of XMLmind Word To XML.
If this supposed to be a conversion tool for turning Word projects into XML
projects so that they can be authored in XML going forward, however, I do have
one major remaining issue.
ID values and filenames are extremely important for making large DITA projects
comprehensible to authors. In my current Word2DITA workflow, I use Paste From
Word to convert to Docbook5,
Strange. Why not use XMLmind XML Editor's "Paste from Word" to paste the
contents of the MS-Word document into an empty DITA topic? This would
give you less work.
where I clean up titles (for topics, tables, figures, examples, etc.)
Cleaning up titles is needed only when the MS-Word user has not used
numbered heading styles, captions styles, etc.
and generate IDs for resources based on the titles. Following that, I heal
xrefs and run the finished Docbook5 file through a set of my own scripts that
transform it to a DITA bookmap project, using the titles of all the topics as
the basis of their filesnames and appending a generated value to the end of
each in order to ensure unique values.
The w2x product is good enough that I'd like to switch my toolchain to use it
instead of my current method, but at that point I'd have to build out a way of
post-processing all the filenames, ID values, and xref targets.
Have I missed a way of doing this in the current tool?
In order to do what you want, you'll have to carefully read XMLmind Word
To XML Manual
(http://www.xmlmind.com/w2x/_distrib/doc/manual/index.html) and
understand how this tool works.
Given when you want to do in terms of topic IDs and the corresponding xrefs:
--> You could create a customized version of
W2X_install_dir/xslt/bookmap.xslt.
That is, create custom_bookmap.xslt as follows:
---
<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/bookmap.xslt"/>
...YOUR CODE HERE...
</xsl:stylesheet>
---
and then run:
w2x ... -o bookmap -t2 custom_bookmap.xslt ...
Most of the code of bookmap.xslt is found in map.xslt, which is neither
long nor complicated. You should have no difficulties adapting it to
your needs.
--> Alternatively, you could create a customized version of
W2X_install_dir/xslt/topic.xslt and let the stock bookmap.xslt do its work:
custom_topic.xslt looks this this:
---
<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"/>
...YOUR CODE HERE...
</xsl:stylesheet>
---
and then run:
w2x ... -o bookmap -t custom_topic.xslt ...
--> Why two possible approaches?
Because:
1) First transformation (-t) topic.xslt translates semantic XHTML to
nested topics.
2) Second transformation (-t2) bookmap.xslt splits the nested topics
generated by topic.xslt into different files and creates a bookmap which
references these files.
References:
* Customizing the semantic XML files generated by w2x
http://www.xmlmind.com/w2x/_distrib/doc/manual/index.html#customizing_semantic_xml
* Table 7-D Parameters of w2x:xslt/topic.xslt, which is used to convert
input XHTML document to a DITA topic
http://www.xmlmind.com/w2x/_distrib/doc/manual/index.html#transform_step
* Table 7-F Parameters of w2x:xslt/map.xslt, bookmap.xslt, which are
used to convert input DITA topic file to a map or bookmap
http://www.xmlmind.com/w2x/_distrib/doc/manual/index.html#transform_step
--
XMLmind Word To XML Support List
[email protected]
http://www.xmlmind.com/mailman/listinfo/w2x-support