Lists Home |
Date Index |
Thanks for your thoughts..
If we see well known XML vocabularies, like say the
XSLT language, we can learn a lot about XML design
from these languages..
XSLT specifies -
<xsl:output method="html" />
and so on..
This gives idea what type of information should be
elements, and what should be attributes..
--- Uche Ogbuji <email@example.com> wrote:
> On Sun, 2005-05-08 at 09:25 -0700, Mukul Gandhi
> > --- Uche Ogbuji <firstname.lastname@example.org>
> > > It can be very dangerous thinking overall. I've
> > > seen numerous examples
> > > of poor XML design because of too literal a
> > > translation from OO
> > > concepts. Just for one example, see  for
> > > discussion of confusion
> > > that arises from the fact that most "object
> > > references" in XML are
> > > implicit.
> > Now I realize, that mapping XML model(using
> > containership and attributes) to OO paradigm is
> > quite appropriate.. For trivial examples, we may
> > so. But we cannot generalize this correspondence.
> > . I
> > read your article . Really a nice article.
> > You have
> > given an example to model a library inventory with
> > XML.. I would like to say a bit about this XML
> > structure you gave -
> > <library>
> > <name>The XML Institute Public Library</name>
> > <books>
> > <book isbn="0764547607">
> > <title>The XML Bible, 2nd Edition</title>
> > </book>
> > <book isbn="0321150406">
> > <title>Effective XML</title>
> > </book>
> > <book isbn="1861005946">
> > <title>Beginning XSLT</title>
> > </book>
> > </books>
> > </library>
> > /library/books/book containership structure seems
> > to me. name is a property of library (object), if
> > model a real world concept.
> I think that "name" is a far more important
> propoerty than the
> artificial abstraction "books". But in the end
> that's why I admit int
> the article it's a matter of judgment.
> > . It could have been made a
> > attribute instead of element (to me, having it as
> > attribute will match the real world view better).
> I think that's a bad idea for a couple of reasons:
> 1) It's really meant for people, not machines. I
> prefer to use
> attributes for metadata-like things with affinity
> towards machines
> 2) It forbids internal structure. If after the
> initial design, it turns
> out there is a library within whose name we really
> want to use
> underlines/italics or such, we have to resort to
> I almost always put names and titles in elements,
> rather than
> attributes, for reasons I elaborate on in several of
> the articles in the
> Principles of XML series.
> Again, this is a good example of how XML modeling
> brings uo different
> concerns from OO modeling.
> > But
> > here, I'll favour aesthetics than the OO
> thinking.. To
> > me, "name" as a child element of "library" appeals
> > more aesthetically. It also seems more tool
> > (like to an XML editor).. For e.g. if a
> > becomes too long (e.g. name) , making it an
> > is not quite readable. Also if there are chances
> > existence of newline in data, I'll prefer to make
> > information as element..
> > So it seems to me now, that designing an XML
> > is also an art, than a pure science..
> Of course it's an art. But to be fair, so is OO
> modeling. Science is
> deterministic, but if you put 5 OO experts in 5
> different rooms with the
> same problem and had them come up with an OO design,
> you'd get 5
> different results.
> > > I think XML requires an entirely different
> > > from objects.
> > Yes.. Now I realize!
> Yaaaay! I do think that's a very important point of
> view to come to. I
> also came to XML from OO, and I still work in OO,
> and I've learned to
> separate the two, to the benefit of both.
> > I read your artcile  also.. Its nice too!
> Thanks again.
> > > 
> > >  http://www.adtmag.com/article.asp?id=8596
> Uche Ogbuji
> Fourthought, Inc.
> Use CSS to display XML, part 2 -
> XML Output with 4Suite & Amara -
> Use XSLT to prepare XML for import into OpenOffice
> Calc -
> Schema standardization for top-down semantic
> transparency -
> The xml-dev list is sponsored by XML.org
> <http://www.xml.org>, an
> initiative of OASIS <http://www.oasis-open.org>
> The list archives are at
> To subscribe or unsubscribe from this list use the
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around