Christian Tismer tismer@trixie.triqs.com
Mon, 24 Apr 2000 15:09:17 +0200


Ken MacLeod wrote:
> Christian Tismer <tismer@trixie.triqs.com> writes:
> > Ken MacLeod wrote:
> > >
> > > Christian Tismer <tismer@tismer.com> writes:
> > [a little about Schemas]
> > ...
> > > I respect the functionality of XML Schema, but to claim its XML
> > > grammar as "more powerful and easy to read" is a big reach.
> >
> > Sorry, it is more powerful than a DTD and easier to read.
> > Feel free to prove the opposite. I'm prepared well.
> I think you may have misinterpreted my comment.  My comment was
> specifically in reference to "But it's all XML, no DTD needed".

Yes, here we have different oppinions.
My point was:
Schema is written in XML.
We have good parsers for XML.
We don't need write yet another parser and don't need
to care about DTDs and possible extensions to them.

> I took this statement to mean "it's better because it's in XML syntax,
> instead of being in a schema specific syntax".  I wasn't trying to say
> DTDs were better than XML Schema, but that XML Schema itself would
> likely be "more powerful and easy to read" if it had it's _own_ syntax
> rather than layering over XML.

XML Schema is a language, defined in terms of XML itself,
together with rules which define the meaning of certain
constructs in the Schema namespace.
Schema definitions are quite a bit more verbose that
their DTD counterparts (as long as they exist), but
they appear to be concise enough to be very readable
for me.

> You later wrote:
> > Writing a schema processor would not involve to write a new XML
> > parser per se, but you would use an existing, probably
> > non-validating parser, maybe one that validates the XSD file.
> Which, although true, does not make the syntax necessarily more
> powerful or easier to read for the most important part of the
> equation: the user who has to write it.  In other words, XMLAuthority
> wouldn't be a required necessity if the syntax of the language (XML
> Schema) weren't so convoluted because it's _in_ XML.

This is true, but I doubt that the majority of users
would still use a text editor to write a schema for
a complex problem. They will need to validate it,
they will want to create test data, and they want to
easily try out different layouts until they are pleased.
Theoretically this is possible to be done by hand, as it
is still possible to write HTML documents by hand. But
I believe you can count those people by the fingers of that hand.

In other words: If problems are real problems, I doubt that
one would create the structure without a good tool.
For simple problems, a schema would be overkill, anyway.

> A parallel is the thread here a few months back about expressing
> programming languages in XML.  Sure, it's possible, but would _you_
> want to write a program in XML rather than Python?  I wouldn't.

No, this isn't parallel. I would of course not write in
XML if I wanted to write Python. A serialization forth
and back would be ok, if it's done by a tool.
But expressing structure *in* the language which is used
to create structured instances is not a particularly new
idea of XML. Databases use recursive metainformation
for their own structured contents since a long time. Doing
so with XML seems to be straight forward to me.

My parallel is the types-sig: Python needs a way to describe
its own types. This will be done by adding some more structures,
but it will still be part of Python, as I understand it.
XML does so by using a couple of name spaces with given meaning.

> > > That ranks up there with using a DOM interface to your application's
> > > data as one of the biggest misuses of XML.
> >
> > What do you try to express by this?
> A common mistake in using XML, similar in spirit to XML Schema being
> expressed in XML, is for people to access their application data
> through a layer of XML exposed through DOM.  DOM is an interface to
> XML information.  Accessing application data represented via XML
> information is an unnecessary and burdensome layer; far better to
> simply convert the XML into application objects and use those
> directly.

Yes, right, but what's the point? Of course I would create
application objects and validate them with the XML schema,
which of course would be converted into some suitable
application object before processing. It would make sense
in the case of Schemas to build some mini-DOMs as an
intermediate step, probably. But after the parsing, there
is no more XML involved, just rules remain which check
for presense, absense and correctness of attributes
and elements. This happens in the moment where we create
the application structure.

What's what I'm missing?

thanks for your patience - chris

Christian Tismer             :^)   <mailto:tismer@appliedbiometrics.com>
Applied Biometrics GmbH      :     Have a break! Take a ride on Python's
Kaunstr. 26                  :    *Starship* http://starship.python.net
14163 Berlin                 :     PGP key -> http://wwwkeys.pgp.net
PGP Fingerprint       E182 71C7 1A9D 66E9 9D15  D3CC D4D7 93E2 1FAE F6DF
     where do you want to jump today?   http://www.stackless.com