Mats B. wrote:

During our testing, it seems that code samples with whitespaces and linebreaks 
are converted to single paras, which is expected of course.

I understand that you offer XML services too. Could you create XED scripts to 
handle the whitespace in the code samples during conversion?

I'm enclosing the docx file that our Help Builder generates, and the resulting 
DocBook after running your converter.

In the docx file, search for the section "Open an Image" to see a code sample 
and then look at the same section in the DocBook XML file. There are many hundreds of 
such code samples in the document.

Please let me know if you can create XED scripts for this and, if so, provide 
us with a quotation.


Your problem is quite simple to solve given the fact that all intermediate XHTML <p> elements containing code samples have a "tp-CodeTable" class.

Please find attached to this email the code_samples.xed script which does what you want.

If you use a command-line to convert your DOCX, please run:

---
w2x -o docbook5 -pu edit.after.blocks code_samples.xed \
   Flir.Atlas.Documentation.docx  Flir.Atlas.Documentation.xml
---

If you use the w2x-app desktop application, please specify in field "Use text file containing w2x options" attached docbook5_options.txt options file. See http://www.xmlmind.com/w2x/_distrib/doc/w2x_app_help/custom_conversion.html




Depending on the tools used to process the generated DocBook5 document, you may want to expand tab characters ('\t') inside a code sample or to generate <programlisting> elements rather than <literallayout> elements.

If this is the case, please do not hesitate to contact us again.
namespace "http://www.w3.org/1999/xhtml";;
namespace html = "http://www.w3.org/1999/xhtml";;
namespace g = "urn:x-mlmind:namespace:group";

for-each /html/body//p[get-class("tp-CodeTable")] {
    set-element-name("pre");
    for-each .//br {
        insert-after(<g:envelope>&#xA;</g:envelope>);
        delete();
    }
}

-o docbook5
-pu edit.after.blocks code_samples.xed

--
XMLmind Word To XML Support List
[email protected]
http://www.xmlmind.com/mailman/listinfo/w2x-support

Reply via email to