[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: XML Schema: DOs and DON'Ts

  • From: Martin Gudgin <marting@d...>
  • To: Kohsuke KAWAGUCHI <kohsukekawaguchi@y...>, xml-dev@l...
  • Date: Wed, 16 May 2001 22:26:17 +0100

xml schema polymorphism
Hi, I've read your document and have a few questions/observations ( and, in
the interests of full disclosure, I *am* a member of the XML Schema Working
Group );


1.    I'm curious as to how you would validate an element that had either
attributes and/or element descendants without using complex types. I may
have missed a major point here but I can't see how to validate;

    <person>
      <name>Martin</name>
      <age>33</age>
    </person>

without defining a complex type to describe the content of person. So, are
you saying "don't use complex types" or are you saying "don't use named
complex types"?


2.    Restriction gives you more that just error checking. You also get a
type relationship between the base type and the derived type. Such a
relationship allows polymorphism which for *some* people is a very useful
feature.

3.    At the end of the day model groups only actually get used when they
are referenced as part of a complex type definition.

4.    Regarding your comment about attribute groups, why not just use a
local attribute declaration? That *is* what you get anyway despite the
syntactic sugar that, it would seem, makes you think otherwise.

5.    Regarding local declarations. I have to take issue with your assertion
that;

<foo:person xmlns:foo="http://best.practice.com">
  <familyName> KAWAGUCHI </familyName>
  <lastName> Kohsuke </lastName>
</foo:person>
is 'bad use of XML namespaces'. I have lots and lots of places where I use
*exactly* that approach and it works very nicely for what I do. I don't
think you can call this one way or the other. Neither approach is *wrong*,
they're just different
6.    I wait with bated breath your comments on substitution groups. To my
mind they are one of the most useful features in XML Schema because they
allow me to avoid using xsi:type ( a cast ) in my instance documents. This
ties in with the polymorphism issue refered to in 1.

7.    Chameleon schemas. I don't feel strongly about this but another way of
looking at the problem is this; use local declarations instead if global
declarations.

Just some thoughts off the top of my head. I'll try and post some more
coherent comments around May 28th ( I just got of a long-haul flight and
won't have time for more comments before then )

Regards

Martin Gudgin
DevelopMentor

P.S. All your namespace URIs for schema have a type they should be
http://www.w3.org/2001/XMLSchema *not* http://www.w3.org/2001/XMSchema (
note missing 'L' character )



----- Original Message -----
From: "Kohsuke KAWAGUCHI" <kohsukekawaguchi@y...>
To: <xml-dev@l...>
Sent: Wednesday, May 16, 2001 6:37 PM
Subject: ANN: XML Schema: DOs and DON'Ts


>
> Hi,
>
> For those who are struggling to learn XML Schema, I wrote an article.
>
> http://www.geocities.com/kohsukekawaguchi/XMLSchemaDOsAndDONTs.html
>
> Comments are welcome. Enjoy!
>
>
> regards,
> ----------------------
> K.Kawaguchi
> E-Mail: kohsukekawaguchi@y...
>
>
> ------------------------------------------------------------------
> The xml-dev list is sponsored by XML.org, an initiative of OASIS
> <http://www.oasis-open.org>
>
> The list archives are at http://lists.xml.org/archives/xml-dev/
>
> To unsubscribe from this elist send a message with the single word
> "unsubscribe" in the body to: xml-dev-request@l...


PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.