[xsl] Pointers are weird

Subject: [xsl] Pointers are weird
From: "Roger L Costello costello@xxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 11 Apr 2025 10:31:49 -0000
Hi Folks,

Occasionally friends come over to my home and I take them on a walk around the
neighborhood. When I see some thing interesting, I raise my hand and position
my index finger in the direction of the interesting thing. That is, I point at
the interesting thing. It seems to me, that that is a real pointer--my index
finger pointing at some thing.

XML has pointers, e.g.,

<Book ref="SK">...</Book>

<Author id="SK">Stephen King</Author>

The value of the ref attribute, "SK", points to <Author id="SK">

"SK" doesn't look like a pointer to me. It looks like data. XML-aware tools,
however, treat it as a pointer to the <Author> element with a matching id
value.

HTML has pointers, e.g.,

<a href="#lesson1">...</a>

<p id="lesson1">...</p>

The value of the href attribute, "#lesson1", points to <p id="lesson1">

"#lesson1" doesn't look like a pointer to me. It looks like data. HTML-aware
tools, however, treat it as a pointer to the <p> element with a matching id
value.

I conclude that, in XML and HTML, a pointer is not a pointer at all. It's
data. It's data that is repeated elsewhere in the document: ("SK" ... "SK"),
("#lesson1" ... "lesson1"). For this "pointer fiction" to work, a tool that
processes the document must participate in the fiction and treat ref="SK" as
pointing to <Author id="SK"> and treat href="#lesson1" as pointing to <p
id="lesson1">.

Isn't that weird?

/Roger

Current Thread