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

Re: Newbie Q (Attributes and Elements)

  • From: Chris Smith <smith@i...>
  • To: xml-dev@i...
  • Date: Tue, 25 Aug 1998 23:00:36 -0400 (EDT)

q attributes
On Mon, 24 Aug 1998, Frank Blau wrote:
> Is there a formal rule for the use of Atrributes vs Elements? The
> assumption I am going on (per The XML Primer) is that Attributes are
> best used to communicate information to the browser/application, and
> Elements are best used for actual Data. Is this a valid assumption?

Whatever seems to work best for your application is the best
assumption. In addition, I have found that sometimes I want to
*prevent* further structuring of data (and make this clear to users),
and those items get placed in attributes. They're flat and they stay
that way. You should also check the attribute normalization sections -
if you are doing validation, then you can get the parser to do more
work for you in some cases - and if it is justified by your
application.

> In an EDI transaction, I was going to put the Header and Trailer
> information in attributes, with the actual Detail Segments as
> Elements...

My specific reaction here is that all of the Header and Trailer and
Detail Segments information is always there - XML or not. As such, I
would try to treat all of these items equally. If you are coming from
a 'record' model of data, you can either have 'one element = one
record' where all the fields are attributes, or you could have 'one
field = one element' and records are grouped by parent elements. You
as the designer have to decide which model serves your needs better.

You should also pay attention to the ongoing namespaces work, since it
seems (myu opinion) to affect the degree of control you can exert on
content through the DTD and validation. I'm beginning to suspect that
this might be one underlying reason for the (again, my opinion)
increased polarization on namespaces following the most recent Working
Draft. 

---------------------------------------------------------------------------
 Chris Smith                                          <smith@i...>



xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@i...
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:majordomo@i... the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo@i... the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@i...)


  • References:
    • Newbie Q
      • From: Frank Blau <fblau@n...>

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Cast Your Vote

We need your help – Vote for DataDirect XML Products!

  • Best SOA or XML site

Winners and finalists announced at SOA World Conference in November.

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.
Email
First Name
Last Name
Company
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-2007 All Rights Reserved.