W3C home > Mailing lists > Public > xmlschema-dev@w3.org > March 2002

General Architecture/Approach Question

From: Snow, Corey <CSNOW@ddpwa.com>
Date: Wed, 6 Mar 2002 12:49:00 -0800
Message-ID: <200203062049.g26Kn2p16292@thumper.deltadentalwa.org>
To: "'xmlschema-dev@w3.org'" <xmlschema-dev@w3.org>
This question is not specific to any one problem I'm experiencing, but as
I'm relatively new to XML schemas, I thought it would be best to get a
little feedback on the direction I'm going before I go too far down a
potentially problematic route.

Basically, I am developing a set of schemas that define a number of
different documents my organization maintains. Since  the types of docments
I'm writing schemas for vary wildly, I came up with a segmented approach. I
have one "master.xsd" file which declares the namespace for the organization
and includes other XSD files (which may in turn include their own, but this
isn't very common- yet).

I also have a "datatypes.xsd", which contains nothing but type declarations
and for some complex types, their subelements. For example, I have an
"AddressType" declaration, which represents a street address, a MoneyType,
and some enumerations for country codes, US states, etc.

Then I have an "elements.xsd", where I declare various reusable elements,
such as a "money" element, based on MoneyType, a "para" element, based on
ParagraphType, and so on.

Then I have a series of schema documents which map one-to-one with the
various document types I manage. I'm continuing to add these schemas to my
collection. These schemas use references to the elements declared in the
elements schema, and don't declare their own elements or types unless they
are explicitly local to the schema in question.

The advantages I've found to this approach is that I keep the number of
actual declarations to a minimum, while maximizing their reusability. Also,
I have no namespace declarations except in my "master" schema file. The rest
of the documents have no declared namespace, but get their namespace by
being included in the master document.

This set of schemas is used to validate various instance documents from a
variety of sources (or will be). Currently I use them to validate instance
documents from a content-management system, after running an XSLT transform
from the format generated by the content-management system into a format
compatible with my schema definitions. I've automated the validation and
transformation process, using MSXML4. Once I have valid instance documents,
I can store them for later use on my web site, or transformation using
XSL:FO or into any other number of formats.

I guess what I'm asking is, are there any major drawbacks (or advantages) to
this kind of approach? Should I be watching out for any particular pitfalls?
The one I'm most concerned about is maintainability, which is why I'm going
as far as possible to centralize the management of the types and elements I
use throughout. I'm wondering if anyone else has comments from their own
experience that might help me avoid the same mistakes others have made. :)

I have a copy of the excellent book "Professional XML Schemas", between
which and the W3 spec is where I picked up just about everything I've
learned up to this point, but there's only so much one can glean from text;
I like to get feedback from real people on occasion. :)

Any comments/feedback would be welcome. Thanks and regards,

Corey Snow

#########################################################
The information contained in this e-mail and subsequent attachments may be privileged, 
confidential and protected from disclosure.  This transmission is intended for the sole 
use of the individual and entity to whom it is addressed.  If you are not the intended 
recipient, any dissemination, distribution or copying is strictly prohibited.  If you 
think that you have received this message in error, please e-mail the sender at the above 
e-mail address.
#########################################################
Received on Wednesday, 6 March 2002 15:49:37 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:29 GMT