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

Re: XML Schema generation questions [was SQL schema to XML schema...]

  • From: "Mike Sharp" <msharp@l...>
  • To: Bob DeRemer <Bob.Deremer@w...>
  • Date: Fri, 23 Jun 2000 12:58:29 -0700

schema sharp


At one point in time, I favored the approach you're suggesting (columns as
attributes), because it seemed easier to code against, and you naturally think
of columns as attributes of a table (thinking in terms of a relational
database).  Now, however, I prefer a more object oriented method, which doesn't
try to represent a relational database structure, but rather represents the
actual structure of the data itself, which isn't usually rectangular.  This
abstracts the database schema, and it seems much more natural to think of, say,
a Person object (which might involve any number of table joins) rather than an
Employees table, joined with a lookup table to a Company Division table etc....
The former approach requires the user of the data to understand the database
schema, which isn't always clear in a complex system.  An object oriented schema
is much easier to follow, in my opinion.

I use attribute in tags to describe the data the element tag represents.  For
example, if an element is read-only, I would have something like:

<Person>
     <EmployeeID RO="TRUE">1234567</EmployeeID>
     <Name>John Galt</Name>
</Person>

That said, there is no "right" or "wrong" way, and XML doesn't require you to
represent data in a tree format at all.  Others on this list have their own
ways, which work for them.

Regards,
Mike Sharp


"Why is lemon juice made with artificial flavor, and dishwashing liquid made
with real lemons?" --KPIG





Bob DeRemer <Bob.Deremer@w...> on 06/23/2000 04:41:44 AM

To:   xml-dev@x...
cc:    (bcc: Mike Sharp/Lante)

Subject:  XML Schema generation questions [was SQL schema to XML schema...]




The one interesting aspect is whether the columns should be Attributes or
Elements.  I've generated "BizTalk" compatible schemas for each type (i.e.
element-based and attribute-based).  I'm not sure yet, which approach is
best.

Being fairly new to XML (i.e. 3 months), I'm curious if others have done
this before.  If so, what they have learned along the way.  My gut instinct
is to keep all columns as attributes, and each table is an element.

If anyone has any suggestions, they would be greatly appreciated.

Thanks again,
Bob




***************************************************************************
This is xml-dev, the mailing list for XML developers.
To unsubscribe, mailto:majordomo@x...&BODY=unsubscribe%20xml-dev
List archives are available at http://xml.org/archives/xml-dev/
***************************************************************************

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.