[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

RE: [xsl] attribute nodes


Subject: RE: [xsl] attribute nodes
From: "Christopher R. Maden" <crism@xxxxxxxxx>
Date: Sat, 05 May 2001 00:58:56 -0700

At 22:29 4-05-2001, Michael Fitzgerald wrote:
Thanks all for answers. In the traditional tree data model in CS, a good
forty years old at least, "if p is the parent of node c, we also say that c
is a child of p." [1] XSLT/XPath in a sense breaks this traditional
relationship wrt attributes, perhaps only as a convenience for tree
traversal. I don't know. I'm asking.  -Mike

And Michael Kay answered, accurately, to my recollection. What additional information are you seeking?


You'll note that the Aho & Ullman definition appears almost verbatim in the XML 1.0 Recommendation. It applies only to elements - a child element has a parent element, and a parent element may have child elements. XPath adopted that model, and extended the terminology where it was logical: for comments, processing instructions, and text nodes, which are ordered within the three. Attributes are not children; I've never seen a discussion of XML that describes them as such, and they don't fit with the observed user expectations of children. They are illustrated as decorations on a tree or tags on boxes, not as descendants or nested boxes.

But this presents a problem. We have the attribute axis for referencing attribute nodes, distinct from the child axis. But an attribute has an "owner" that it is interesting to discuss; what do we call it? There was some considerable debate about breaking the symmetry of child and parent, but for simplicity and least surprise (except among hard-core CS nerds), the final decision seems to have worked well.

-Chris
--
Christopher R. Maden, XML Consultant
DTDs/schemas - conversion - ebooks - publishing - Web - B2B - training
<URL: http://crism.maden.org/consulting/ >
PGP Fingerprint: BBA6 4085 DED0 E176 D6D4  5DFC AC52 F825 AFEC 58DA


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list




Current Thread
Keywords