LISTSERV mailing list manager LISTSERV 15.5

Help for XML-L Archives

XML-L Archives

XML-L Archives


Next Message | Previous Message
Next in Topic | Previous in Topic
Next by Same Author | Previous by Same Author
Chronologically | Most Recent First
Proportional Font | Monospaced Font


Join or Leave XML-L
Reply | Post New Message
Search Archives


Re: Basic question about elements


"John E. Simpson" <[log in to unmask]>


General discussion of Extensible Markup Language <[log in to unmask]>


Wed, 25 Aug 1999 23:05:18 -0400





text/plain (57 lines)

At 04:24 PM 08/25/1999 -0400, Tac/Smokescreen Action Network wrote:
> there any good reason to
>group the lists together into list elements, e.g.
>I did this on my first attempt at XML, but the reason was that I wanted to
>check for the existence of an element before writing out a header (and then
>looping through the individual items) in my XSL, but that design is probably
>based on my own inability to check for the existence of something before
>beginning a loop on it.

I don't know if my reasons qualify as good ones or not, but personally I
like to do this sort of "grouping." Two reasons, off the top of my head:

(1) Aesthetically and logically, it enforces on the content a structure
that seems more purely in keeping with XML's nature. It's certainly
possible (and in some cases maybe even desirable) to build a more or less
completely flat-structured document. Have you seen MSIE's default
representation of a well-formed XML document -- the collapsible/expandable
tree? A document "structured" in this flat style would look something like
      - Root element
         - Element 1
         - Element 2
         - Element 3
Not much of a "structure," eh? To the extent that XML is explicitly about
data structures, why not take advantage of it?

(2) I came to XML with background in RDBMSes (as well as HTML). For this
reason, I tend to think of data stores in terms of tables and records.
Under this model, what you're calling a grouping might be analogous to a
table, with the individual sub-elements constituting records within the
table. Now, the similarities between XML and RDBMS sructure aren't perfect,
but I do like the idea of being able to manipulate a collection of like
things *as* a collection, as well as singly or in one-after-the-other fashion.

As with anything else, it's possible to overdo the "structuralizing" of a
document. But once it's been structured, it's a relatively simple matter to
*reduce* the structure for a given purpose, via XSL or some other
programmatic means. Much harder to go in the other direction. So I prefer
to err on the side of not knowing to what purpose the data might be put, by
structuring it as much as possible.

John E. Simpson
[log in to unmask]
Just XML - Now available from Prentice-Hall

Back to: Top of Message | Previous Page | Main XML-L Page



CataList Email List Search Powered by the LISTSERV Email List Manager