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

Re: What comes first, the schema or the document

From: Boris Kolpackov <boris@codesynthesis.com>
Date: Mon, 14 Jul 2008 08:41:41 +0200
To: xmlschema-dev@w3.org
Cc: "'Lyallex'" <lyallex@gmail.com>, Michael Kay <mike@saxonica.com>
Message-ID: <20080714064141.GA9267@karelia>
Re: What comes first

Hi,

Michael Kay <mike@saxonica.com> writes:

> I think it's very common for people to start with a sample instance and then
> create a schema for it. In fact, the sample instance is often a better way
> of communicating the structure than the schema itself.

That only works for fairly simple vocabularies. As soon as you start having
choices, optional/sequence elements/attributes, the number of separate
instances required to "show" the vocabulary becomes unmanageable. Plus this
approach has a negative side effect of people stopping to care how their
schemas look since nobody is supposed to look inside.

I think for any non-trivial vocabulary it is better to start with a clean
and readable schema right away and maybe have one or two sample instance
documents that showcase the most common scenarios.

Boris

-- 
Boris Kolpackov, Code Synthesis Tools   http://codesynthesis.com/~boris/blog
Open source XML data binding for C++:   http://codesynthesis.com/products/xsd
Mobile/embedded validating XML parsing: http://codesynthesis.com/products/xsde
Received on Monday, 14 July 2008 06:46:44 GMT

Subscribe to the Stylus Scoop newsletter for helpful XML tips and tutorials.
Email
First Name
Last Name
Company

Download Stylus Studio 6 XML Enterprise Edition

Subscribe in XML format
RSS 2.0
Atom 0.3
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-2007 All Rights Reserved.