View Single Post
Old 06-05-2014, 05:29 AM   #5
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,737
Karma: 24031401
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by GMcG View Post
There is no problem with Calibre. So what's wrong?
Calibre accepts pretty much any file. OTOH, Sigil is more strict in its interpretation of standards.
Most likely Sigil expects a space and a dtd reference.

Quote:
Originally Posted by GMcG View Post
(It is possible to copy the html code, paste it into Sigil and then let it be fixed automatically, but it is not the fastest way if you have many files.)
If you have hundreds of files that are formatted like this and are not averse to using a command line tool, you could install sed and use the following one-line script with it:

Code:
# sed -f sigil.sed -i *.html
s/<!DOCTYPE html PUBLIC "-\/\/W3C\/\/DTD HTML 4\.01 Transitional\/\/EN">/<\?xml version="1\.0" encoding="utf-8" standalone="no"\?>\n<!DOCTYPE html PUBLIC "-\/\/W3C\/\/DTD XHTML 1\.1\/\/EN"\n  "http:\/\/www\.w3\.org\/TR\/xhtml11\/DTD\/xhtml11\.dtd">/g
I.e., install sed*, save the above code as a sigil.sed in the folder that contains the .html files that you want to modify. Then open a DOS prompt, navigate to the folder with the .html files and enter the following command:

Code:
sed -f sigil.sed -i *.html
This will change all doctype declarations to Sigil style doctype declarations. Since this command will overwrite the original files, you may want to create backup copies first.

*If you have a Mac or a Linux machine you won't have to install sed.
Doitsu is offline   Reply With Quote