[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Why Are Schemas Hard? (WAS RE: "Uh, what do I need this for" (wasRE: XML.COM: How I Learne d t o Love daBomb))
- From: Peter Piatko <piatko@research.telcordia.com>
- To: Jeff Lowery <jlowery@scenicsoft.com>,'Michael Brennan' <Michael_Brennan@allegis.com>,"'Bullard, Claude L (Len)'" <clbullar@ingr.com>,'Nicolas LEHUEN' <nicolas.lehuen@ubicco.com>
- Date: Fri, 24 Aug 2001 11:23:55 -0400
Jeff, et al,
----- Original Message -----
From: "Jeff Lowery" <jlowery@scenicsoft.com>
To: "'Michael Brennan'" <Michael_Brennan@allegis.com>; "'Bullard, Claude L
(Len)'" <clbullar@ingr.com>; "'Nicolas LEHUEN'" <nicolas.lehuen@ubicco.com>
Cc: "'xml-dev'" <xml-dev@lists.xml.org>
Sent: Thursday, August 23, 2001 8:14 PM
Subject: RE: Why Are Schemas Hard? (WAS RE: "Uh, what do I need this for"
(was RE: XML.COM: How I Learne d t o Love daBomb))
> > > 1. What about Schemas is hard?
>
> To me, it boils down to whether they're conceptually hard or syntactically
> hard. If it's the later, then tools will mask the syntax difficulties. It
> seems the WG went beyond well-formedness and strived to remove any
implicit
> assumptions, for example:
>
> <element name="foo">
> <complexType>
> <sequence>
> <element name="bar" type="string"/>
> <element name="baz" type="integer"/>
> </sequence>
> <attribute name="qux" type="decimal"/>
> </complexType>
> </element>
>
At the risk of sounding like a broken record about this, I find that it is
too easy to declare local elements without really meaning to (did you really
intend for <bar> and <baz> to be locally scoped?). One can argue about the
various merits/demerits of local scoping, but the concept should be made
clear to the schema author. I'd almost be happy with a <local-element>
element.
<snip/>
> If Schemas are conceptually hard, that's a different matter. certainly the
> rules for namespaces, <all> model groups, and seemingly odd inheritance
> restrictions certainly are difficult to master. Here, tools may help by
> enforcing these rules through edit controls and choice presentation, but
> that's not sufficient for understanding by the schema author. To
understand,
> he needs not only to know the spec (which is no easy task), but the
> decisions and compromises that were made in the writing of the
> Recommendation.
Neglecting local elements for a moment, I didn't find the rules for
namespaces overly difficult. Then again, maybe there are some esoteric
rules that I just don't know about. I couldn't figure out the reason behind
the elementFormDefault attribute until I started reading this list---I
vaguely understood the rules, but not the purpose behind it. I think this
is an area where the Part 0 tutorial could be enhanced. I can't say that I
totally understand model groups, substitution groups and all of the
inheritance rules.
OTOH, I believe I can write simple schemas w/o ever using these features. I
am a firm believer that simple tasks should be easy to do. Sometimes
complex tasks are hard to do and there is no getting around it, so perhaps
some of the complexities of XML Schema are necessary. As long as they don't
get in the way of the simple tasks I'd be happy.
<snip/>
Thanks,
Peter