Christian K. wrote:

I have one last follow-up question: Is there a w2x option to pretty print the 
generated DITA out-of-the-box, so that it is human-readable? I can't seem to 
find such option in the options reference ...


No, there is no such option because (unless implemented with great care) such option would add whitespace in locations where whitespace is meaningful.

For example, you may get horrible (and incorrect, because this is not what the author wrote using MS-Word) things such as:

<p>
  Hello
  <b>world</>
  !
</p>

If you want to give this a try, simply edit <W2X_install_dir>/xslt/map.xslt using a text or XML editor and replace indent="no" by indent="yes" everywhere in this file.



--> Our recommendation:

In order to generate DITA source which is nice to read, please proceed as follows:

1) Generate DITA using w2x (of course, with the stock indent="no" setting).

2) Use a *smart* third-party program to pretty print the generated DITA source.

For example:

xmltool indent *.dita *.ditamap

Because xmltool uses the DITA schema to learn where whitespace is meaningful, this utility adds indentation whitespace only in locations where it is harmless to do so.

You'll find xmltool in <XXE_install_dir>/bin/, XXE (XMLmind XML Editor) Evaluation Edition may be freely from this page:

http://www.xmlmind.com/xmleditor/download.shtml

The documentation of xmltool is found here:

http://www.xmlmind.com/xmleditor/_distrib/doc/xmltool/index.html



--
XMLmind Word To XML Support List
w2x-support@xmlmind.com
http://www.xmlmind.com/mailman/listinfo/w2x-support

Reply via email to