Generating XML conforming to a custom schema

In order to use w2x to convert a DOCX input file to an XML output file conforming to your custom schema, all you have to do is write a custom XSLT 1.0 stylesheet converting the “semantic” XHTML 1.0 Transitional generated by the Edit step to your custom schema.

Let’s call your custom XSLT 1.0 stylesheet “C:\Users\John\foo\xsl\xhtml_to_foo.xsl”. Command-line tool w2x must then be passed the following options:

Stock XED script w2x:xed/main.xed creates a number of semantic XHTML elements having a class attribute starting with “role-“. Examples: <div class=”role-section1”>, <div class=”role-section2”>, <div class=”role-figure”>, <div class=”role-figcaption”>, <a class=”role-footnote-ref”>, <div class=”role-footnote”>, <a class=”role-xref”>, <span class=”role-index-term”>, etc. To learn how to process these elements, the simplest is to look how this is done in a stock XSLT stylesheet such as “w2x_install_dir/xslt/topic.xslt” or “w2x_install_dir/xslt/docbook.xslt”.