Lists Home |
Date Index |
"Rick Jelliffe" <firstname.lastname@example.org> writes:
> From: "Dare Obasanjo" <email@example.com>
> > I do agree that mixed content is the probably the most relevant
> > differentiator between data-centric & document-centric uses of XML.
> I think mixed content also entails some other things:
> * a presumption that data and elements are ordered,
> * a presumption that tags delimit ranges within some larger text stream
> rather than independent atoms of information.
> These presumptions then require some syntactic form for better
> representing information items that are not mutually ordered and do contain
> atoms rather than ranges: hence attribute syntax.
Not to contradict this observation, but I don't think XML attributes
are almost exclusively of value to docheads.
I find an excellent, language-level, round-trippable mapping between
XML attributes and relational ones. Note that the mapping to elements
is not nearly as good.
* Like SQL attributes, XML attributes are semantically unordered.
* SQL attribute names must be unique within a relation, XML attribute
names must be unique in an element.
* SQL attributes can be NULLable; XML attributes can be #IMPLIED.
* Like SQL attributes, XML attributes have names and atomic values
(SQL99 even has an (anti-1NF) array datatype to map to tokenized
* XML attributes on an element can be viewed as a relation named by
that element and vice versa.
<PERSON NAME="K. Ari Krupnikov" EMAIL="firstname.lastname@example.org" READS="xml-dev"/>
INSERT INTO PERSON (NAME, EMAIL, READS)
VALUES ("K. Ari Krupnikov", "email@example.com", "xml-dev")