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

element content vs. element attribute

  • From: Ray Waldin <rwaldin@p...>
  • To: xml-dev@i...
  • Date: Sat, 20 Dec 1997 19:33:06 -0800

attribute vs element
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@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...)


PURCHASE STYLUS STUDIO ONLINE TODAY!

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.
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-2013 All Rights Reserved.