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

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   element content vs. element attribute

[ Lists Home | Date Index | Thread Index ]
  • From: Ray Waldin <rwaldin@pacbell.net>
  • To: xml-dev@ic.ac.uk
  • Date: Sat, 20 Dec 1997 19:33:06 -0800

Hi everyone,

I've used XML twice now and in both cases I've ended up with nothing to markup
except more tags and whitespace :).  These languages are used to communicate
relationships between external resources, not marked up text.  The intent was to
describe these relationships in a flexible but well defined format and XML
offered a simple (and soon to be standard!) way of doing this.  So far, so
good.  

I've seen other examples of this type of "pure tag language" and noticed that
some of them seem to force content into tags for no reason.  My question is,
given the "nothing to markup" scenario, which is more appropriate?, when is each
more appropriate?, and why?:

<blah>1234</blah>

or

<blah value="1234" />

In other words, when should data be contained by elements?  Or conversely, when
should data be an attribute of an element instead of contained by that element? 
I prefer the latter method, given an attributes ability to store CDATA without
CDATA section delimiters.  OSD and CDF use the former method for:

<TITLE>Solitaire</TITLE>

and I'm not sure why as:

<TITLE value="Solitare" />

could serve the same purpose and is more inline with the rest of the language. 
Any general guidelines?  

Thanks!

-Ray

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)





 

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

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