[tex4ht] fix to extra space at begin of xml file

Francesc Guasch frankie at etsetb.upc.edu
Fri Nov 12 17:19:42 CET 2010


Hi.

I was using tex4ht to  convert a tex file to openoffice when it
suddenly started failing with:

    The processing instruction target matching "[xX][mM][lL]" is not
    allowed

Digging deep I found it was a problem about extra space added
at the beginning of the xml file like this:

       <?xml version="1.0" encoding="UTF-8"?>

Finally I solved it changing the configuration file tex4ht.env.
Instead doing "mv" xml files are processed via perl so the
extra space is removed.

Here is a diff.


280c280
< .4oo mv %%0.4oo %%0.tmp
---
> .4oo cat %%0.4oo  | perl -ne 's/\s.*(<\?xml.*)/$1/; print ' > %%0.tmp
313c313
< .4oy mv    %%1.4oy         sxw-%%0.dir/styles.xml
---
> .4oy cat %%1.4oy  | perl -ne 's/\s.*(<\?xml.*)/$1/; print ' >
 sxw-%%0.dir/styles.xml




More information about the tex4ht mailing list