Re: [O] DTD prohibited

2014-06-05 Thread Rick Frankel

On 2014-06-04 12:52, AW wrote:

Am Mittwoch, 4. Juni 2014, 17:04:14 schrieb Eric Abrahamsen:
Eric S Fraga e.fr...@ucl.ac.uk writes:
 On Tuesday,  3 Jun 2014 at 22:14, AW wrote:

 [...]

 Hi,

 thank you, I started again digging into this strange thing and the
 culprit
 seems the first line of the html-file:

 ?xml version=1.0 encoding=utf-8?

Seems like simply exporting as html5 might solve the problem.

Yes, it does, thank you. But the price is that tabulars lose the frames 
and

lines. I did not invest whether due to export without those elements or
because Word had issues with html5.


It's because the html5 export has no default style for tables --
before opening in word, try opening the html in a browser, you will
see that xhtml-strict export adds style info to the table element, but 
xhtml5 doesn't.


If you want the same style in html5 as html4, try the following
preamble in your org file:

#+HTML_DOCTYPE: xhtml5
#+HTML_HEAD: style type=text/css
#+HTML_HEAD: table {
#+HTML_HEAD: border-top: thin solid gray;
#+HTML_HEAD: border-bottom: thin solid gray;
#+HTML_HEAD: }
#+HTML_HEAD: thead {border-bottom: thin solid grey;}
#+HTML_HEAD: td, th {padding: 6px;}
#+HTML_HEAD:/style

FYI, here's the table definition output in html4:

table border=2 cellspacing=0 cellpadding=6 rules=groups
frame=hsides

and html5

table

rick



Re: [O] DTD prohibited

2014-06-04 Thread Eric S Fraga
On Tuesday,  3 Jun 2014 at 22:14, AW wrote:

[...]

 Hi, 

 thank you, I started again digging into this strange thing and the culprit 
 seems the first line of the html-file:

 ?xml version=1.0 encoding=utf-8?

 If I remove this line, no error.  And removing simply 

Have a look at 

,[ C-h v org-html-xml-declaration RET ]
| org-html-xml-declaration is a variable defined in `ox-html.el'.
| Its value is
| ((html . ?xml version=\1.0\ encoding=\%s\?)
|  (php . ?php echo \?xml version=\\\1.0\\\ encoding=\\\%s\\\ ?\; 
?))
| 
| 
| Documentation:
| The extension for exported HTML files.
| %s will be replaced with the charset of the exported file.
| This may be a string, or an alist with export extensions
| and corresponding declarations.
| 
| This declaration only applies when exporting to XHTML.
| 
| You can customize this variable.
| 
| [back]
`
-- 
: Eric S Fraga (0xFFFCF67D), Emacs 24.3.1, Org release_8.2.6-1133-ga5c863



Re: [O] DTD prohibited

2014-06-04 Thread AW
Am Mittwoch, 4. Juni 2014, 17:04:14 schrieb Eric Abrahamsen:
 Eric S Fraga e.fr...@ucl.ac.uk writes:
  On Tuesday,  3 Jun 2014 at 22:14, AW wrote:
  
  [...]
  
  Hi,
  
  thank you, I started again digging into this strange thing and the
  culprit
  seems the first line of the html-file:
  
  ?xml version=1.0 encoding=utf-8?
  
  If I remove this line, no error.  And removing simply
  
  Have a look at
  
  ,[ C-h v org-html-xml-declaration RET ]
  
  | org-html-xml-declaration is a variable defined in `ox-html.el'.
  | Its value is
  | ((html . ?xml version=\1.0\ encoding=\%s\?)
  | 
  |  (php . ?php echo \?xml version=\\\1.0\\\ encoding=\\\%s\\\
  |  ?\; ?)) | 
  | Documentation:
  | The extension for exported HTML files.
  | %s will be replaced with the charset of the exported file.
  | This may be a string, or an alist with export extensions
  | and corresponding declarations.
  | 
  | This declaration only applies when exporting to XHTML.
  | 
  | You can customize this variable.
  | 
  | [back]
 
 Seems like simply exporting as html5 might solve the problem.

Yes, it does, thank you. But the price is that tabulars lose the frames and 
lines. I did not invest whether due to export without those elements or 
because Word had issues with html5.

So I think I stick for the time being with customization of org-html-xml-
declaration.




Re: [O] DTD prohibited

2014-06-03 Thread AW
Am Dienstag, 3. Juni 2014, 00:34:58 schrieb James Harkins:
 Bastien bzg at gnu.org writes:
  Hi Alexander,
  
  AW alexander.willand at t-online.de writes:
   Now, Word no longer can open the html-documents produced by orgmode. The
 
 error
 
   message is (translated from German): DTD prohibited.
  
  You may want to customize `org-html-doctype' but you probably need to
  digg further to know what DTD is prohibited exactly.
 
 Apparently, all of them:
 
 http://en.m.wikipedia.org/wiki/Document_Type_Definition
 
 Under Security:
 
 ~~
 An XML DTD can be used to create a denial of service (DoS) attack by
 defining nested entities that expand exponentially, or by sending the XML
 parser to an external resource that never returns.[10]
 
 For this reason, .NET Framework provides a property that allows prohibiting
 or skipping DTD parsing, [10] and recent versions of Microsoft Office
 applications (Microsoft Office 2010 and higher) refuse to open XML files
 that contain DTD declarations.
 ~~
 
 So, if org ODT export now depends on a DTD, then we'd have to say that we
 don't support exported files that open in MS Word.
 
 hjh


Hi, 

thank you, I started again digging into this strange thing and the culprit 
seems the first line of the html-file:

?xml version=1.0 encoding=utf-8?

If I remove this line, no error.  And removing simply 

xml version=1.0 

helped as well. Courious. Because of such behaviour I hate Word, but ...

Source: http://stackoverflow.com/a/15816168

Regards,

Alexander



Re: [O] DTD prohibited

2014-06-02 Thread Bastien
Hi Alexander,

AW alexander.will...@t-online.de writes:

 Now, Word no longer can open the html-documents produced by orgmode. The 
 error 
 message is (translated from German): DTD prohibited.

You may want to customize `org-html-doctype' but you probably need to
digg further to know what DTD is prohibited exactly.

HTH,

-- 
 Bastien



Re: [O] DTD prohibited

2014-06-02 Thread James Harkins
Bastien bzg at gnu.org writes:

 
 Hi Alexander,
 
 AW alexander.willand at t-online.de writes:
 
  Now, Word no longer can open the html-documents produced by orgmode. The 
error 
  message is (translated from German): DTD prohibited.
 
 You may want to customize `org-html-doctype' but you probably need to
 digg further to know what DTD is prohibited exactly.

Apparently, all of them:

http://en.m.wikipedia.org/wiki/Document_Type_Definition

Under Security:

~~
An XML DTD can be used to create a denial of service (DoS) attack by defining 
nested entities that expand exponentially, or by sending the XML parser to an 
external resource that never returns.[10]

For this reason, .NET Framework provides a property that allows prohibiting or 
skipping DTD parsing, [10] and recent versions of Microsoft Office 
applications (Microsoft Office 2010 and higher) refuse to open XML files that 
contain DTD declarations.
~~

So, if org ODT export now depends on a DTD, then we'd have to say that we 
don't support exported files that open in MS Word.

hjh