Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: XML's style

From: Joe Kesselman <keshlam-nospam@-------.--->
To: NULL
Date: 7/4/2006 12:56:00 PM

howachen@g... wrote:
> people tends to use elements instead of attributes....too many
> attributes is no good?

This is a FAQ. See past discussion. In general, use attributes when you 
want to help refine the description of something, child elements when 
you want to give the information it contains -- BUT remember that 
attribute values are unstructured, and if at any point you're going to 
want to have structured data it's going to have to be an element. Also 
remember that attributes only allow a single instance per element; if 
there will ever be more than one, that too pushes you toward elements.

Beyond that, it's very much a matter of taste. There's no limit on the 
number of attributes, so if you really need 20 different qualifiers on 
an element you can do it that way just as easily as via child elements. 
Though any single datum with 20 fields is probably made up of several 
sub-structures, and you should consider whether it's better 
architecturally to break those out.

-- 
() ASCII Ribbon Campaign  | Joe Kesselman
/\ Stamp out HTML e-mail! | System architexture and kinetic poetry


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