I am exporting my org-mode file via org-export-as-html, but when I check the file type via file my/file.html, it is XML. I notice the first three lines in my HTML exported file is the following:
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
which is a reasonable explanation. If I manually re-order these lines to the following:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<?xml version="1.0" encoding="iso-8859-1"?>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
then the file is correctly identified as HTML. How do I correct this issue in my export function? I checked the org-mode docs here but they seem out of date:
http://orgmode.org/manual/HTML-Export-commands.html#HTML-Export-commands
because I do not have their listed commands, but org-export-to-html and org-export-as-html-to-buffer.
Any suggestions would be very helpful.
BTW I am on Emacs 24.3 with Ubuntu 14.04. Here are the first few lines of my org file:
Flatsheet Project Mgmt -*- mode: org -*-
#+TODO: TODO IN-PROGRESS WAITING DONE
#+INFOJS_OPT: view:overview toc:true
* project stuff...
* more project stuff...
UPDATE
I found this link potentially helpful, but their suggestion is not working:
http://doc.norang.ca/org-mode.html
There is a section called 16.8.2 Export HTML without XML header, but their solution below does not work for me:
(setq org-html-xml-declaration (quote (("html" . "")
("was-html" . "<?xml version=\"1.0\" encoding=\"%s\"?>")
("php" . "<?php echo \"<?xml version=\\\"1.0\\\" encoding=\\\"%s\\\" ?>\"; ?>"))))
org-versionwhat do you get, and did you try setting the equivalent oforg-html-doctype?filesays?orgpackage, which is apparently under heavy development. I was at 7.9x, but I upgrade to the latest stable and it works! It looks like they redid the exporter, which should make everything smoother from here on out :-)