OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: Newbie Q (Attributes and Elements)

[ Lists Home | Date Index | Thread Index ]
  • From: Chris Smith <smith@interlog.com>
  • To: xml-dev@ic.ac.uk
  • Date: Tue, 25 Aug 1998 23:00:36 -0400 (EDT)

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@interlog.com>



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


  • References:
    • Newbie Q
      • From: Frank Blau <fblau@nina.snohomish.wa.gov>



 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS