Re: 2 Questions about validations
- From: Henri Sivonen <hsivonen@xxxxxx>
- Date: Sun, 11 Sep 2005 12:50:45 +0300
In article <3mm6i11k7rju6med54m42b03ems1cn0078@xxxxxxx>,
Jan Roland Eriksson <jrexon@xxxxxxxxxxx> wrote:
> Actually, in SGML any character that is not defined as a name character
> or a function character is a 'delimiter'
Good to know. Thank you!
> >(But XML 1.0 always requires one or more white space characters there.)
>
> My curious mind wonders why any one would find it necessary to set up
> such a requirement?
>
> [1] <p class="foo"title="bar">baz</p>
>
> [2] <p class="foo" title="bar">baz</p>
>
> Any one half decent programmer would have no problem what so ever to
> define the algorithm necessary that would parse [1] and [2] into exactly
> the same result in the parse tree. And we do not need access to a DTD
> entity to aid the process either.
I do not know what the actual rationale was. However, requiring the
space there makes the formal grammar of XML 1.0 simpler and requires
less supporting English text.
In theory, having the low-level grammar 100% in BNF without exceptions
in English that change *s into +s in certain cases allows the use of
parser generators when implementing the low level of an XML processor
that recognizes tags, comments, PIs, character data, etc. in a character
stream (but does not yet check for duplicate attributes and tag nesting,
etc.). However, in practice, XML processors seem to be 100% hand-rolled
anyway.
> Me still thinks that a lot of already acquired and very useful knowledge
> was sent down the hatch by W3C's move to "take over" XML from those who
> already knew what they where doing.
When I read the XML 1.0 spec, it made sense to me (well, perhaps the
existence of DTDs didn't and the nature of white space didn't). It still
makes sense (except for DTDs and the dual nature of white space) when I
read the spec again.
When I first started reading the annotated Standard in the Handbook, my
first impression was that I was so glad I didn't have to implement it.
Every time I open the Handbook and read a passage of the Standard, I am
left in awe because of two things:
1) The prose looks like it was written by lawyers or mathematicians who
were primarily avoiding stating anything twice for the fear of
introducing two conflicting statements instead of looking like it was
written by computer scientists writing a spec with implementability in
mind.
2) The burden that is placed on the implementor is huge compared to XML
1.0. No wonder there are more independent interoperable implementations
of XML 1.0. (The other explanation for that is that specs that are
available on the Web for free win.)
Considering what you get in the SGML parse tree in the end, all the
syntactic sugar that can be used to get stuff in the tree seem radically
blown out of practical proportions. So once in a while one has to wonder
if the writers of the SGML spec got carried away or knew what they were
doing.
--
Henri Sivonen
hsivonen@xxxxxx
http://hsivonen.iki.fi/
Mozilla Web Author FAQ: http://mozilla.org/docs/web-developer/faq.html
.
- References:
- Re: 2 Questions about validations
- From: Jukka K. Korpela
- Re: 2 Questions about validations
- From: Henri Sivonen
- Re: 2 Questions about validations
- From: Jan Roland Eriksson
- Re: 2 Questions about validations
- From: Henri Sivonen
- Re: 2 Questions about validations
- From: Jan Roland Eriksson
- Re: 2 Questions about validations
- Prev by Date: Re: 2 Questions about validations
- Next by Date: Is creating a fill-out form a science?
- Previous by thread: Re: 2 Questions about validations
- Next by thread: Re: 2 Questions about validations
- Index(es):
Relevant Pages
|
Loading