Lists Home |
Date Index |
- To: Uche Ogbuji <email@example.com>
- Subject: Re: [xml-dev] attribute order
- From: Mukul Gandhi <firstname.lastname@example.org>
- Date: Sun, 8 May 2005 09:25:21 -0700 (PDT)
- Cc: "G. Ken Holman" <gkholman@CraneSoftwrights.com>, XML List Developers <email@example.com>
- Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; b=M+S7CtfbA/ELD9pPsLYKqT4d8qNG61PShr6pESjlC68Q5M4e/S6XRUreKBtKMDdVduBI4/bgluiWh7UcAqSH+a052e9gMg3yJS3Xn7mB0agbTZI0aSkzyNOott9aJ31JPBOK9fXxdWvwB8syLv/panfk/u2wzT6scQ2lVjwuZQc= ;
- In-reply-to: 6667
--- Uche Ogbuji <firstname.lastname@example.org> wrote:
> 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
Now I realize, that mapping XML model(using element
containership and attributes) to OO paradigm is not
quite appropriate.. For trivial examples, we may do
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 -
<name>The XML Institute Public Library</name>
<title>The XML Bible, 2nd Edition</title>
/library/books/book containership structure seems fine
to me. name is a property of library (object), if we
model a real world concept.. It could have been made a
attribute instead of element (to me, having it as
attribute will match the real world view better). 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 friendly
(like to an XML editor).. For e.g. if a description
becomes too long (e.g. name) , making it an attribute
is not quite readable. Also if there are chances of
existence of newline in data, I'll prefer to make the
information as element..
So it seems to me now, that designing an XML document
is also an art, than a pure science..
> As for the specific question of XML versus
> attributes, I still think
> it's a weak approach. OO concerns such as identity
> and data typing
> which drive the matter in program modeling have poor
> correspondence in XML. I think you'd be fine with
> such an approach with
> trivial examples, but the elements/attributes choice
> is usually trivial,
> anyway, if the example is also trivial.
I agree with you..
> > So attribute ordering will not be the right
> Well, not so quickly. In OO, object references
> aren't ordered, either
> (you need to use an explicit vector to get order),
> so element ordering
> wouldn't be the right concept, either, if one were
> being so literal.
Your point seems right to me.. Sometimes, it may seem
tempting to impose ordering semantics on attributes.
But it will not be wise to design applications based
on "attribute ordering semantics" (as XML spec
prohibits this). In such case, either we should model
information as container elements, or let the
application take care of attribute ordering (for e.g.
applications may sort attributes by name)..
> I think XML requires an entirely different mind-set
> from objects.
Yes.. Now I realize!
> I also don't think this is fruitful territory. One
> could pick a
> dictionary definition of elements (e.g. the agents
> of weather) where
> order does matter, and one (e.g. the fundamental
> units of chemical
> compounds) where order does (at least in the sense
> of structuring in the
> periodic table). Again, I see nothing but
> misapprehension and confusion
> down this road.
I just thought.., dictionary meaning of attribute may
match XML attribute concept.. I guess, I was wrong to
think like this.. XML attributes are just name value
pairs seperated by = sign. There is no other meaning
attached to this construct.. We can utilize this name
value = construct(i.e. attributes) within applications
in any way we wish..
> Just as it's dangerous to do relational modeling in
> an OO mind-set, and
> vice versa (part of the reason those two worlds have
> so stubbornly
> resisted merging ), it's dangerous to do XML
> modeling in either mind-
> set, and so on.
I read your artcile  also.. Its nice too!
Thanks for your insightful thoughts..
>  http://www.adtmag.com/article.asp?id=8596
> see also debate of  at
> 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!?
Yahoo! Mail - Find what you need with new enhanced search.