[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
Re: [xml-dev] Quiz: is this XML well-formed?
- From: "Liam R. E. Quin" <liam@fromoldbooks.org>
- To: Roger L Costello <costello@mitre.org>, "xml-dev@lists.xml.org" <xml-dev@lists.xml.org>
- Date: Thu, 04 Feb 2021 14:43:54 -0500
On Thu, 2021-02-04 at 18:18 +0000, Roger L Costello wrote:
> But, but, but, ... Why is space required between attributes? Surely a
> parser can recognize the start of the next attribute given the end-
> delimiter of the previous attribute's value, yes?
In SGML the rules for attributes were (are) much more complex, because
of minimization. At SoftQuad, minimization and related features
represented approximately 80% of our support costs for Author/Editor
(an SGML editor).
I won't say you couldn't set up an SGML declaration to permit those
spaces to be elided, but they were generally needed because in SGML the
quotation marks were optional if the attribute value was declared as a
list,
<!ATTLIST boy
socks (grey|grubby|torn|lost) #REQUIRED
weapon (conker|plushie|manupulative-cry|none) "none"
>
let you write <boy grey plushie>...
Note it's the attribute names that can be omitted, so that e.g. in
HTML, strictly speaking when you write <table border>you are not
setting an attribute called border, you are supplying the value of
border and the parser has to determine to which attribute it belongs
(in practice you are setting border="border"). Unfortnately,
implementers of HTML didn't have access to the actual SGML spec (i sent
a copy of the SGML Handbook to one of them!) because at ₤300 or more,
it was well over the budget of a graduate student, so they guessed, and
it looked like <table border> was the same as <table border="true">, so
that's more like how HTML works. But XML came out of SGML.
Now, as Ken pointed out, we wanted every valid XML document to be an
SGML document. After a huge fight, in the end, SGML was actually
modified to make this possible, and if we had not had the fight but had
been able to work together, we could have made a number of decisions
differently; wanting asymmetric comment tokens was another for example,
where i'd proposed <!--* .... *--> for comments. <!- ... -> would have
beeen possible too, if SGML could have been modified to allow it.
But above all else we wanted a language easy to process and parse - the
"desperate Perl hacker" should be able to change all occurrences of
2021 in a part number without affecting dates. So we required the full
attribute="value" with no minimization, but didn't revisit the space
there.
It is not, i think, too onerous - a space is in any case needed after
the element name even though <boytornconker> might not be ambiguous in
a given DTD, but it can be difficult for a human to determine this.
Liam
--
Liam Quin, https://www.delightfulcomputing.com/
Available for XML/Document/Information Architecture/XSLT/
XSL/XQuery/Web/Text Processing/A11Y training, work & consulting.
Barefoot Web-slave, antique illustrations: http://www.fromoldbooks.org
[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]