On 7/25/05, Ray Denenberg, Library of Congress <[log in to unmask]> wrote:
> > No
>
> Nor is there any reason TO use elements only and not to use attributes.
elements are ordered, attributes are not
elements are extensible, attributes are not
XSD and DTD validation are reasonably smart about element content, but
not about attributes
Isn't that enough?
more below ...
[...snip...]
> (And as an aside, it would seem rather arrogant of rdf to insist that we
> build xml without attributes -- if indeed that's what rdf is insisting, and
> I'm not convinced -- when rdf itself couldn't exist without them, as
> illustrated for example by: <mads:otherRelation
> rdf:resource="Systems_Analysis"/>; so rdf must think that attributes are
> pretty useful.)
It's fair to point that out: that in and of themselves attributes are
not the problem. In that sense I suppose you could reasonably argue
it's a red herring of sorts with respect to RDF. This is valid
RDF/XML document AFAIK:
<Person name"Jane Doe" rff:about="doej"/>
The problem is stuff like:
<relatedItem type="host">
<name type="personal">
That particular use of attributes (as I and others have repeatedly
pointed out) is problematic from both an XML standpoint and an RDF
standpoint. In the first case, it makes adding validation constraints
more difficult, and in the second, it breaks the model.
Basically, everywhere in MODS and MADS where things get a little
tricky from a data modeling standpoint, the choice has been to use
generic elements and have optional attributes; to leave the structure
loose. That has consequences, including precluding RDF compliance.
It also makes the resulting instances more difficult to process as XML
I'd argue, because it's perfectly legal to abuse it in all kinds of
ways.
I went so far as to write my own MODS schema in RLEAX NG to try to get
a handle on some of this, but even RNG only goes so far (for example,
the interleave feature to allow unordered element content doesn't yet
cover cases where one wants to interleave structures with the same
element names and different attribute values).
Bruce
|