[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: texi to epub
From: |
Per Bothner |
Subject: |
Re: texi to epub |
Date: |
Sat, 18 Dec 2021 13:58:30 -0800 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.0 |
On 12/18/21 13:01, Patrice Dumas wrote:
It seems that it does not change the work required compared to XHTML 1.1
which is to have a correct XML document. Something I cannot find,
however, is what to put at the beginning to be able to check validity
of the resulting document if it is HTML5 XML. Can you please tell me?
As far as I can tell, you don't need to put anything at the start:
https://html.spec.whatwg.org/multipage/xhtml.html#the-xhtml-syntax
A validator should allow you to specify what you want to validate against.
This should be OK:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
For "polyglot" output, leave off the <?xml?> declaration.
It seems to me that XML_OUTPUT_MODE "polyglot" would only need changing
some customization variable for the header, so I am not so convinced
that it is really interesting.
A major difference between XML and HTML is the handling of empty elements.
The following are valid HTML:
<a name="foo">
<a name="foo"></a>
<hr>
The following are valid XML:
<a name="foo"/>
<a name="foo"></a>
<hr></hr>
<hr/>
Note that the following are *invalid* HTML:
<hr></hr>
<a name="foo"> -- error if not followed by a closing </a> tag
while this is invalid XML:
<hr>
<a name="foo">
The following ("polyglot") output is suggested is they are valid both as HTML
and XML:
<hr/>
<a name="foo"></a>
You have to know which elements have empty content (hr) and which don't (a).
--
--Per Bothner
per@bothner.com http://per.bothner.com/
- Re: texi to epub, (continued)
- Re: texi to epub, Patrice Dumas, 2021/12/16
- Re: texi to epub, Per Bothner, 2021/12/16
- Re: texi to epub, Patrice Dumas, 2021/12/16
- Re: texi to epub, Gavin Smith, 2021/12/18
- Re: texi to epub, Patrice Dumas, 2021/12/18
- Re: texi to epub, Per Bothner, 2021/12/18
- Re: texi to epub, Patrice Dumas, 2021/12/18
- Re: texi to epub,
Per Bothner <=
- Re: texi to epub, Patrice Dumas, 2021/12/18
- Re: texi to epub, Per Bothner, 2021/12/18
- Re: texi to epub, Patrice Dumas, 2021/12/19
- Re: texi to epub, Jacob Bachmeyer, 2021/12/18
- Re: texi to epub, Jean-Christophe Helary, 2021/12/18
- Re: texi to epub, Gavin Smith, 2021/12/19
- Re: texi to epub, Patrice Dumas, 2021/12/19
- Re: texi to epub, Patrice Dumas, 2021/12/19
- Re: texi to epub, Per Bothner, 2021/12/19
- Re: texi to epub, Patrice Dumas, 2021/12/20