I've had a failure to export a Writer document to xhtml and epub using
the export filters of the extension Writer2xhtml. Export to html using
LO's native export filter does work ok.
The export hangs for a few seconds and then quits with a first error
message, entitled ":Internal error in conversion" - and saying :
"org.w3c.dom.DOMException: INVALID_CHARACTER_ERR: An invalid or illegal
XML character is specified. at
Clicking OK produces a LibreOffice error saying that a "Write Error" had
occurred and the file could not be written. Then Writer falls over and
has to be restarted.
This type of export is an operation I've done hundreds of times over the
past several years with the current setup and with earlier versions of
LO and I've never had a problem before. I can still do this export
operation with other Writer files including earlier versions of the
problem file, so I expect that the particular document concerned has
some corruption somewhere. Since it is rather lengthy and in the final
stages of editing, it contains lots of recent small edits but nothing
that I could say was unusual.
Can anyone help with understanding what that 'illegal XML character'
error means and how I can track down more precisely where the error is ?
I've solved my problem. And thankyou Brian for the message you sent.
I went back to a backup which did export correctly to epub and xhtml and
then looked for what changes I had made between that 'good' copy and the
'bad' document. I undid the changes progressively while testing the
conversion at intervals.
On 16/07/17 18:02, Philip Jackson wrote:
> operation with other Writer files including earlier versions of the
> problem file, so I expect that the particular document concerned has
> some corruption somewhere.
The only fault was a web hyperlink formed in an unusual manner. Normally
when I form a hyperlink in Writer, I place the url in the 'Target' field
of the dialog box and the text that will be shown underlined as the
clickable link goes in the 'Text' field. I leave the 'Name' field blank.
However, on one occasion out of dozens in this document, a hyperlink
which I probably copied and pasted from somewhere on the web, had the
same entry 3 times - in the 3 fields : Target, Text, Name.
Once I deleted the Name entry, the document now exports correctly.
I can't say I understand why that was a problem but I'm pleased that it
has now gone away.