Closed Zegnat closed 9 years ago
Your explanation sounds good enough to me.
Note that the HTML/XHTML files in this repository have the same issue: it’s all a matter of interpretation. Except in HTML5, there is a difference between what browsers/programs support, what the spec allows, and what the validator says.
XML 1.0, well-formed (xml-1.0.xml
):
<_/>
XML 1.0, well-formed and valid (xml-1.0-valid.xml
):
<!DOCTYPE _[<!ELEMENT _ EMPTY>]><_/>
First time reading I thought the XML declaration was required, but on a second reading I realised only prolog
is required for a well-formed document and it can be empty (i.e. without XML declaration). I’ll check out XML 1.1 later and will make a pull request when I have them. Early Saturday, probably.
Nice work! Looking forward to the PR :)
@mathiasbynens shouldn't this be closed after the resolution of #34?
@waldyrious You’re right. Thanks!
By strict reading of the XML 1.0 standard am I right to assume the smallest possible XML file is the following?
This does validate as ‘well-formed XML’ on the W3C Markup Validator. The only odd part is that the root element is seen as
_/
rather than_
. Looks like a bug, because it does treat the slash as a closing slash.Not sure if I should pull, requesting comment.
A XML document is:
Where:
And:
With:
While:
In short we get this when all optional (marked by
?
or*
) parts are left out: