<!document ...>
<a><c></c></a>
<!document ...>
<!element a O O (b,c)>
<a><c></c></a>
They just have different semantics. If parsed as HTML, the first produces a DOM with two nodes and the second produces a DOM with three nodes.By way of contrast, this is syntactically incorrect:
<table><tr><td>data</img>
So is this: <img src=x<y.html>
There is no DOM that corresponds to those two examples.One of the (many) problems with SGML is that it muddies the distinction between syntax and semantics. That is one of the (many) reasons that using S-expression syntax to write SGML-like languages is advantageous.
Are you talking to me? I've just pointed out how SGML works and didn't say anything about syntax/semantics.
> > If you have a good strategy for validating your template files, I'd love to hear it!
> Use S-expression syntax instead of SGML syntax [emphasis added]
Note the use of the word syntax. I'm talking about syntax. All of your responses have been at best irrelevant or at worst wrong because you either don't understand what syntax is, or you chose to ignore it. It's damned annoying, particularly when you start making demonstrably false claims like, "it's nowhere close to the power of SGML as a text format" (https://news.ycombinator.com/item?id=13569991).
This is covered in depth in the linked paper/slides (in fact, covering JimDabell's example exactly).