Chapter 16: XML, XLink

XML + XLink + XPointer, written as if I’m sitting next to you — explaining patiently, step by step, with many examples, analogies, real-world context, and common confusion points.

We’ll go slowly so you really understand what these technologies are, why they were created, how they work, and why they are rarely used today (very important to know the honest reality in 2025–2026).

1. The Big Picture: What are XLink and XPointer?

XLink and XPointer were created in the late 1990s / early 2000s as part of the XML family to solve one main problem:

How do we create rich, two-way, typed, bidirectional links inside XML documents — much more powerful than simple HTML <a href=”…”> links?

Technology Purpose Main idea Status in 2025–2026
XLink Define links (simple or extended) Describes how to link between resources Almost never used today
XPointer Point to specific parts inside a resource Describes where exactly to go inside an XML/HTML document Almost never used today

Very important reality check (you should know this):

  • Both were very ambitious and theoretically elegant
  • Both were very complex to implement correctly
  • Browsers never fully supported them (only very partial support in early Firefox / Opera)
  • Today almost no one uses XLink or XPointer in real projects
  • Most people who need linking in XML use simple attributes (href, id, idref) or switch to JSON + URLs

Still — you should understand them because:

  • You will meet them in old documentation, government standards, publishing formats, older XML specifications
  • Some niche domains (technical documentation, legal XML, DocBook, DITA) still mention them

2. First Concept: XLink – The Link Itself

XLink allows you to create links inside XML documents that are:

  • Typed (simple vs extended)
  • Bidirectional (in theory)
  • Multi-destination (link to many resources at once)
  • Descriptive (you can say what kind of link it is)

There are two main kinds:

Type HTML equivalent When to use it Most common syntax
Simple link <a href=”…”> Normal one-way link (most common) xlink:type=”simple” + xlink:href
Extended link No real HTML equivalent Complex links (multiple targets, roles, arcs) xlink:type=”extended” + <arc> + <resource>

Very First Simple XLink Example

XML

Key attributes (you must remember these):

Attribute Possible values Meaning / most common usage
xlink:type simple / extended Simple = like HTML <a>, Extended = complex
xlink:href Any URI Where the link points (must always be present)
xlink:title Text Human-readable description (tooltip in theory)
xlink:show new / replace / embed / other How to show the target (new = new tab)
xlink:actuate onLoad / onRequest When to activate (onRequest = user clicks)

Reality check: Browsers ignore almost all of these except xlink:href and xlink:type=”simple”. Most real systems treat XLink simple links exactly like HTML links.

3. Extended XLink (the ambitious part – rarely used)

Extended links allow:

  • Multiple resources
  • Bidirectional links
  • Role-based connections (arcs)

Example (very rare in practice)

XML

Honest truth: You will almost never see extended XLink in real projects. It was too complicated → no browser support → no tools supported it well.

4. XPointer – Pointing to Specific Parts Inside a Document

XPointer tells where exactly inside a document the link should go.

There are three main ways (you should know them):

XPointer scheme Syntax example What it does Still used?
element() element(chapter5) Go to element with id=”chapter5″ Rarely
xpath() xpath(//section[@id=’intro’]) Use full XPath expression Very rarely
bare name (id) #chapter5 Shorthand for element(chapter5) Most common (still!)

Most realistic example (what you actually see sometimes)

XML

Reality check:

  • #id style (bare name) → still sometimes used (because HTML does it)
  • element() → almost never
  • xpath() → almost never (too complex, no browser support)

5. Real-World Status in 2025–2026 (very important)

Situation What people actually do today
Need to link to another XML document Use normal href=”file.xml#id” or href=”url#id”
Need to link inside HTML Use HTML <a href=”#section”>
Need rich linking metadata Use custom attributes + JSON-LD / microdata
Publishing / DocBook / DITA Use link / xref elements with href + idref
Government / legal XML Usually simple href + fragment identifiers

Bottom line:

  • XLink simple + bare #id → still appears sometimes
  • Full XLink extended / XPointer XPath → museum technology

Quick Summary – What You Should Remember

Feature Most realistic usage in 2025–2026 Typical syntax
Simple XLink Like HTML link xlink:type=”simple” xlink:href=”…”
Bidirectional / multi-target Almost never used
XPointer bare name Jump to element with that id file.xml#chapter3
XPointer element() Very rare file.xml#element(sec2)
XPointer xpath() Extremely rare file.xml#xpath(//p[3])

Practical advice:

If you see XLink in modern code → usually it is only the simple form and treated like a normal hyperlink.

Would you like to continue with one of these next?

  • Real examples from DocBook, DITA, or TEI (where XLink still appears sometimes)
  • How HTML5 and modern web replaced most of XLink/XPointer
  • Comparison: XLink vs HTML <link> / <a> vs JSON-LD
  • Why XML hyperlinking failed compared to HTML
  • How fragments (#id) still work today in XML + HTML

Tell me which direction feels most useful or interesting for you right now! 😊

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *