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

Re: Tag for every column in every row

  • From: Rick JELLIFFE <ricko@g...>
  • To: xml-dev@x...
  • Date: Wed, 12 Apr 2000 18:57:30 +0800

> Yihpyng Kuan ask about redundancy in xml documents:
> > I am new to XML, I have a question here, I wonder if
> > anyone can shed some light on it, many thanks.

Elements are horrible for transporting around data, sometimes.
Perhaps a clearer way to mark up your document would be something 
like this:

<Table id="T1">
 <element name="row">
  <attribute name="F1" type="CHAR" length="10" />
  <attribute name="F1" type="CHAR" length="10" />
<row F1="data 1" F2="data 2" /> 
<row F1="data 3" F2="data 4" />
<row F1="data 5" F2="data 6" />

The bottom line with attributes is that you cannot use them where
you need to have nested data within them. Lots of people have
good but different opinions on what you should use attributes
for: XML itself is neutral. (In general, if people have
a logical divide in their data, they will often use attributes
for one and data-in-elements for the other: for example,
if your data can be divided into "formal" data and "textual"
data you might use attributes for the "formal" data; or if
your data is organized into "text" and "metadata" you
might use attributes for the "metadata". )

The tradeoffs change for lots of different factors. For example,
if you are sending short documents the document you suggested
might be fine. If you are sending longer documents and you
are using streaming tools (e.g. one that processes one row at
a time), you may find the above better. 

Rick Jelliffe

B.t.w., you might also find it convenient to use more expressive
names than "Table" and "row". For example, "Staff" and "Person"
or whatever.

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/


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.
First Name
Last Name
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.