OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help



   Re: [xml-dev] syntax, model

[ Lists Home | Date Index | Thread Index ]

On Friday 24 October 2003 13:33, Rich Salz wrote:
> > We're not connecting on something here, because for me, that XML
> > snippet does describe a data model. It says an Address is composed
> > of a Street, Country and Postal Code. What else is there for a
> > data model to say about an Address?
> Write the C struct that corresponds to that snippet; you can't.

My C might be a little rusty, I switched to Java about 7 years

struct Address {
    Street street;
    Country country;
    PostalCode postal_code;

What information is required to write the C struct that is not
provided by the XML snippet? The only possibility I can see is the
member names. In C, elements of a data structure are accessed by
name, whereas in XML, you have to search through the list of
children for an element matching the expected type (ie: namespace
qualified element name). For me, the difference in access
conventions is about the execution model, not the data model. Is
this what you're talking about, or is it something different?

> That
> snippet can fully define a piece of XML, but it doesn't fully define a
> data model.

I could also draw a UML class diagram, or ER diagram, for the XML
snippet. These are "data model" modelling tools.

> Perhaps that's our disconnect:  I assume that your
> requirements for a data model including mapping it into a conventional
> programming language.  If you're satisfied with not being able to map
> that snippet into a language, then we're closer than we appear.

I think the mapping question is orthogonal. Once you have a
description of how the XML document is structured, you can write
code to map from the abstract syntax tree defined by the XML
Infoset to the abstract syntax tree defined by your local
programming environment.

Is your point that the description of the data model not be biased
towards mapping to any particular execution environment? If so, I
agree. The data model should only describe the structure of the
exchanged data. We should be working at the level of an ER

My point is only that there is a data model. There has to be for
people to know where to get particular information from the XML
file. I have to know where to look for the Street.

XML programmers use and exchange data models. Without the data
model, all you've got is a tree of strings, and no way of knowing
which string to use for what. The thing you use to pick a string
is the data model.



News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS