OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   RE: RE: [xml-dev] XQuery and DTD/Schema?

[ Lists Home | Date Index | Thread Index ]
  • To: <xml-dev@lists.xml.org>
  • Subject: RE: RE: [xml-dev] XQuery and DTD/Schema?
  • From: "Derek Denny-Brown" <derekdb@microsoft.com>
  • Date: Wed, 3 Jul 2002 18:16:31 -0700
  • Thread-index: AcIiyrrYLn9JRa8QRBKEmWZ8qtoFKQAJr2Lw
  • Thread-topic: RE: [xml-dev] XQuery and DTD/Schema?

> -----Original Message-----
> From: Simon St.Laurent [mailto:simonstl@simonstl.com]
>
> XML is a wonderful set of tools for marking-up information with
labeled
> structures.

XML is a wonderful tool for (a) marking-up textual data and (b) interop
of 'data', typically serializations of either relational or object
structures.  I work with people using XML to great success for both
purposes.  Both purposes have alternate solutions, which may be better
in some cases, but for whatever reason XML has been chosen as the tool
of the day.  SOAP ensures that huge numbers of people, and mostly people
who would never invest the time to join xml-dev, will fall into the (b)
camp above.  I express no opinion on whether SOAP as XML is good or bad,
but it most definitely _is_.

Many people in the (b) camp see XML as an abstraction.  They could care
less about the syntax, but are looking for a tool to pass information
between systems such that they can leverage many existing tools to
process that information along the way.  The (b) camp typically involves
files where no human ever sees the data.  All they care about is interop
and tools.

> DTDs and RELAX NG pretty much acknowledge that foundation, and build
on it
> cleanly.  RELAX NG's use of structural patterns seems like a perfect
fit
> for the capabilities inherent in XML and markup generally.

DTDs provided a moderate solution to (a) and simple cases of (b) above,
but failed miserably for complicated (b).  RELAX NG is hugely better,
and is an elegant solution to validating that an XML document which was
received (be it scenario (a) or (b) ) conforms to your expectations.
Where both DTDs and RELAX NG falter, is integrating the XML solution
into the OOP/Relational world that is the rest of the application.

> W3C XML Schema throws away these understandings of labeled structures,
and
> instead proceeds to create a mash of type systems which impose
themselves
> on the structures of XML rather than meshing cleanly with
> them.  Effectively, W3C XML Schema bolts a variety of understandings
from
> the OOP and relational database worlds, and bolts them onto XML
> haphazardly, with no respect for notions like "element type
definition"
> that came with XML 1.0.

WXS was the solution proposed by a number of people who were looking for
solutions to specific problems.  The fact that those people chose to
ignore some of the traditional notions of XML should say something.
Those traditions failed to accommodate their needs.

I am hardly one to argue that WXS is a beautiful thing.  I live with
managing a developer team who daily faces the reality of working with
the juggernaught that WXS became.  It really bothers me that WXS is so
complicated that my (very good) devs have such a difficult time figuring
it out, and completely misunderstand parts.

That said, WXS really does solve problems that RELAX NG does not.  Named
types are _necessary_ for good language integration.  Type-derivation is
extremely important also, and maps well to existing data-modeling tools.
Sure you can live w/o it.  The original C++ compilers compiled down to C
(which is an unfair example, but holds none-the-less).  That doesn't
mean that developers should just write C code and not C++ code, but
instead makes clear that the abstractions introduced in C++ were just
and evolution of what existed in C.  WXS adds some abstractions too the
schema language which the authors deemed necessary. 

> RELAX NG makes me think of a set of houses built to fit in their
> environment, with minimum impact on the surrounding terrain.  W3C XML
> Schema makes me think of a subdivision built by clearcutting the area
and
> then building houses according to plans that worked well enough
someplace
> else.

But what if those houses are designed for people from that someplace
else?  They expect their new houses to be similar to their old houses,
to work in similar ways.  Mankind has a long history of doing exactly
this, and pounding that square peg until it fits, by a bit of both
shaving off some edges and stretching out the whole.

> Perhaps that's merely an aesthetic point, something W3C XML Schema is
> notoriously bad at anyway.  Technically, however, I think the
impedance
> mismatch between W3C XML Schema and XML itself is severe, as W3C XML
> Schema's notion of type has only passing connections to XML 1.0's
notion
> of
> type.  The W3C seems more inclined to force these notions into XML and
> related technologies than to ask whether this is appropriate in the
first
> place.

Just because those traditional XML notions have been around for a while
does not mean that they are the only way to view things.  People used to
think that the sun orbited the earth.  Then science came along and said,
no, the earth orbits the sun, in a circle.  Then science realized it
wasn't quite a circle.  Then Einstein pointed out that everything is
relative, and that you could view the sun as orbiting the earth.
Relational and OOP oriented people are trying to use XML, and will
continue to do so.  Work with them, not against them.

You can ignore the portions of WXS which don't fit your application.  If
that leaves a core that does not meet your demands, then you should
provide specific feedback to the WXS 1.1 committee about what is
missing.  Just because it allows you to do things which are bad, does
not mean that it is bad.  C allows me to dereference a NULL pointer and
crash my program, so is it a bad programming language?

Dredging up the ancient document vs data debate... WXS attempts to
satisfy the perceived needs of both camps.  Where if fails, it should be
corrected.

I sincerely wish WXS could have been based on a validation framework
like RELAX-NG combined with distinct object layer, but it wasn't.  C++
is not perfect either, but has become a rather popular.  It is not just
that it was better than the alternatives.  It was that it fit into the
existing frameworks, etc..  WXS has already been accepted as part of
many XML frameworks, so lets work to improve it.  Starting from scratch
always looks easier, but then runs headlong into troubles when you
attempt to interoperate with existing frameworks expecting the old.

I'm not trying to parade a company line, and am one of the people 'round
here who have held that WXS has some serious problems, and RELAX-NG has
some good insights.  I just try to be a practical person, and experience
has taught me that the elegant is not always the winner.  Given a
choice, I'd be writing much of my code in lisp or sml, not C++.  That
choice would mean that my solutions would help multiple orders of
magnitude less people.  I'm here to make solutions for people, so I live
with #define and other ugliness.  In return I go to conferences and hear
people talk about how they used my software to solve real-world
problems.  That just feels good.

-derek




 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS