Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - Re: XML's style >Thread Next - Re: XML's style Re: XML's styleTo: 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 | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
