Re: node vs. element

Subject: Re: node vs. element
From: puff -at- guild -dot- net
To: IanFe -at- Attachmate -dot- com
Date: Tue, 3 Oct 100 04:07:29 -0400 (EDT)

Ian Ferguson (ianfe -at- attachmate -dot- com) writes:
> I'm writing developer documentation, annotating a sample XSLT file. I want
> to refer to what the XML spec calls elements, but my SME calls nodes. After
> reviewing several sources, I've found that much XSL documentation uses these
> terms in a way that appears random. In a single document, I'll see "nodes,"
> "elements," and "element nodes." In addition, the "root" is sometimes called
> the root, root node, or root element.

This happens, as is often the case in computer-related
discussions, because the terms used to discuss something are specific
to how that thing is interacted with (often the role it plays), not
necessarily what it is. The classic example is client and server; the
terms denote the roles two things play in an exchange of information.
A program that acts as a server in one exchange may turn around and
act as a client in another. With a lot of things in CS contexts,
there is no "what" there, only roles and relationships.

In this case, I'll bet the distinction is in whether they're
talking about an XML element in relation to its content or in relation
to the structure of the XML document.

Specifically, an XML element is a set of information defining
some informational unit, whether you call it an element or an entity
or a thingie. In XML the unit is usually defined by a start and an
end tag and any attributes in the tag and any subelements defined
between the start tag and end tag.

However, the XML document itself can be examined as a structured
hierarchy. In computer science they usually call such things
"graphs", a graph being a collection of nodes and edges - a node being
a point in the graph, and an edge being a connection between two
points in a graph*. XML document structures are hierarchical (usually
a hierarchy based on containment), hence they are a tree graph, but
they're a graph nonetheless, and the simplest term for a point in a
graph is "node."

(* Is this all starting to sound circular? Try coming up with a
better way of defining this stuff that doesn't become
self-referential and you'll start to see why CS terminology so
often ends up that way).

I hope this has cleared things up :-).

Steven J. Owens
puff -at- guild -dot- net




Previous by Author: Re: Re: Anyone a Business System Analyst?
Next by Author: Re: Name that TLA
Previous by Thread: Re: node vs. element
Next by Thread: Re: node vs. element


What this post helpful? Share it with friends and colleagues:


Sponsored Ads