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

Re: Attribute Usage

From: Bryce K. Nielsen <bryce@sysonyx.com>
Date: Thu, 17 Mar 2005 20:38:45 -0700
Message-ID: <004a01c52b6b$fe44e470$650fa8c0@PREZ>
To: <xmlschema-dev@w3.org>
Re: Attribute Usage

> What is the purpose of element attribute?  And is there a usage
> rule-of-thumb for element attribute (attribute vs. child element) ?
>

As noted, there is no hard-fast rule. Most programmers I've dealt with tend
to prefer elements over attributes, probably because at first, with DOM,
it's easier to deal with elements than attributes. Probably the best
argument I've heard for elements over attributes is that they can be
extended a lot easier. On the other hand, the best argument for attributes
has got to be size. If you deal in large XML documents (like I do,
converting EDI into XML), then the XML document can be drastically reduced
if you use Attributes for your "fields" (there's only one name per field,
instead of two for the open/close tag of elements).

All in all, I personally prefer using elements over attributes, though see
valid justifications for both, pure and mixed.

HTH,

Bryce K. Nielsen
SysOnyx, Inc. (www.sysonyx.com)
Makers of xmlLinguist, the affordable EDI to XML Translator
http://www.sysonyx.com/products/xmllinguist
Received on Friday, 18 March 2005 03:39:00 GMT

Subscribe to the Stylus Scoop newsletter for helpful XML tips and tutorials.
Email
First Name
Last Name
Company

Download Stylus Studio 6 XML Enterprise Edition

Subscribe in XML format
RSS 2.0
Atom 0.3
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.