[tcs-lc] Question about XML attribute vs. element

Richard Pyle deepreef at bishopmuseum.org
Mon Mar 21 16:18:41 PST 2005


Thanks, Bob!

So....what do you think "NomenCode" should be -- an element, or an attribute
(for NameDetailed)?

Rich

> -----Original Message-----
> From: tcs-lc-admin at ecoinformatics.org
> [mailto:tcs-lc-admin at ecoinformatics.org]On Behalf Of Bob Morris
> Sent: Monday, March 21, 2005 2:09 PM
> To: tcs-lc at ecoinformatics.org
> Subject: Re: [tcs-lc] Question about XML attribute vs. element
>
>
> In general, some of this comes down to taste and practice. Among the
> differences are that attributes (a) must be unique within a given
> element (b)must be of simple type (technical term; in practice, it means
> no structure) (c) have indeterminate order, no matter what the order
> appears to be in the file. The last is a slight oversimplification but
> you should expect that applications need not deliver attributes in the
> order they are in the file, and may even rearrange them without being
> justly accused of changing the file.
>
> Almost anything by Elliotte Rusty Harold is worth reading. See
> http://www.cafeconleche.org/slides/sd2004west/xmlfundamentals/
> for discussions of this and other questions and see
> http://www.cafeconleche.org/ for lots of other neat stuff about XML
> technologies.
>
> Bob
>
>
>
> Richard Pyle wrote:
> > What is the basic rule for when to designate something as an attribute,
> > rather than a separate element, in an XML schema?
> >
> > Specifically, I'm thinking about "NomenCode" in TCS v095.  Right now, it
> > appears as an element within NameDetailed.  But why
> couldn't/shouldn't it be
> > represented instead as an enumerated attribute of NameDetailed?
> >
> > Aloha,
> > Rich
> >
> >
> > _______________________________________________
> > tcs-lc mailing list
> > tcs-lc at ecoinformatics.org
> > http://www.ecoinformatics.org/mailman/listinfo/tcs-lc
>
> --
> Robert A. Morris
> Professor of Computer Science
> UMASS-Boston
> http://www.cs.umb.edu/~ram
> phone (+1)617 287 6466
> _______________________________________________
> tcs-lc mailing list
> tcs-lc at ecoinformatics.org
> http://www.ecoinformatics.org/mailman/listinfo/tcs-lc





More information about the Tcs-lc mailing list