Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Attribute Usage

From: "Bryce K. Nielsen" <bryce@-------.--->
To: <xmlschema-dev@--.--->
Date: 3/17/2005 1:39:00 PM
> 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


From ht@i... Fri Mar 18 09:18:11 2005
Received: 


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent