comp.lang.ada
 help / color / mirror / Atom feed
From: Georg Bauhaus <sb463ba@l1-hrz.uni-duisburg.de>
Subject: Re: Experiences of XML parser generators for Ada?
Date: Sat, 4 Dec 2004 13:59:47 +0000 (UTC)
Date: 2004-12-04T13:59:47+00:00	[thread overview]
Message-ID: <cosfsj$hkq$1@a1-hrz.uni-duisburg.de> (raw)
In-Reply-To: mailman.170.1102160463.10401.comp.lang.ada@ada-france.org

Marius Amado Alves <amado.alves@netcabo.pt> wrote:
:>>so here comes my advice: think twice before using xml.
:>>xml is a very powerful tool for DYNAMICALLY STRUCTURED HUMAN READABLE 
:>>TEXT.
:> 
:> Human readable? I have an impression that punched cards were more readable!
:> XML reminds me one implementation of Algol 60, in which all keyword were
:> upper case put in quotes, e.g. 'BEGIN'. Though, even that was more readable
:> than XML.
: 
: Indeed XML has failed its two main purposes, which were to be readable 
: by humans and efficiently processable by machines.

Complete nonsense.

First, as has been demonstrably envisioned by the creators of
SGML, the XML subset is NOT designed to be readable-in-the-sense-of
"as easy to read as your well typeset sunday newspaper."

What is meant by "human readable text" is that structured values
can be represented as text, explicitly naming the parts and relations.
If a human looks at three bit patterns, he/she will have to
know context and a bit of luck in order to be able to interpret
the bit patterns like a computer does.
If a human looks at

  <issue-date   year="2003"  month="4" day="31" />

the three bitpatterns have been made structured human readable text,
and it is a lot more clear what is meant when compared to three
bit patterns.
Imagine you are hunting bugs, e.g. Year 2000 bugs in a four-company
distributed program, and all you get as diagnostic aid is decimal
representations of bare, unnamed numbers buried in a server program's
trace output, 
Then you cannot tell the month value and the day value apart,
same size, ranges overlap.
There might be ambiguities if there is no minimum markup, like a
comma separating values.
You can't tell without further research or luck whether these value
represent an issue date or a birth date.

If you want less intrusive markup, for example because you are an author,
you want to type the markup yourself, but you still want your document
instances almost as readable as plain text, say so. Write "SHORTAG YES"
for example, into your SGML declaration. Use more than the XML subset
then.

Second, XML parsing can be a lot more efficient than SGML parsing with
SHORTREF YES, SHORTTAG YES, CONCUR etc.
XML validation, if needed, has to be compared to the checking that
your program does when it doesn't use XML for middleware data
communication.
Of course, as has been said in this thread, if you transform
values from their machine representation into text, and back, this
will take time.  But this time is not necessarily lost. What you
get is a program-independent represenation of data.

If you don't need all this, then I guess you can brew your own data
representation, and let all your programs communicate with themselves.


-- Georg



  parent reply	other threads:[~2004-12-04 13:59 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-02 21:04 Experiences of XML parser generators for Ada? Daniel W
2004-12-02 22:19 ` Georg Bauhaus
2004-12-03  8:57 ` Martin Krischik
2004-12-03  9:16   ` Adrien Plisson
2004-12-03 20:42     ` Daniel W
2004-12-03 23:33       ` Adrien Plisson
2004-12-04  8:05         ` Dmitry A. Kazakov
2004-12-04 11:40           ` Marius Amado Alves
2004-12-04 13:14             ` Martin Krischik
2004-12-05 16:27               ` Jeffrey Carter
2004-12-05 17:58                 ` Dmitry A. Kazakov
2004-12-04 13:59             ` Georg Bauhaus [this message]
2004-12-05  8:47               ` Martin Krischik
2004-12-06 11:18                 ` Georg Bauhaus
2004-12-06 18:12                 ` Pascal Obry
2004-12-13 20:34                   ` Florian Weimer
2004-12-05  1:50             ` David Botton
2004-12-04 14:01           ` Georg Bauhaus
2004-12-04 16:27             ` Dmitry A. Kazakov
2004-12-06  5:59         ` Daniel W
2004-12-06 14:48         ` Marc A. Criley
     [not found] <20041203110026.6F40B4C408A@lovelace.ada-france.org>
2004-12-03 23:18 ` Robert C. Leif
2004-12-07 19:41   ` Björn Persson
  -- strict thread matches above, loose matches on Subject: below --
2004-12-04 20:37 Robert C. Leif
2004-12-04 22:53 ` Adrien Plisson
2004-12-08 23:37   ` Lionel Draghi
2004-12-09 12:29     ` Georg Bauhaus
2004-12-09 21:04       ` Lionel Draghi
2004-12-09 21:09     ` Lionel Draghi
2004-12-10 22:09     ` Simon Wright
2004-12-11  0:02       ` Lionel Draghi
2004-12-11  9:03         ` Pascal Obry
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox