W3C

Implementation Report for XLink 1.1

XML Core Working Group

9 February 2010

Abstract

This document lists preliminary implementation feedback about XLink 1.1 implementations known by the XML Core Working Group at this time.


All XLink 1.0 documents are conforming XLink 1.1 documents

All existing documents that use XLink 1.0 (RDDL, XBRL, METS, …) are also conforming XLink 1.1 documents.

All XLink 1.1 documents can be trivially transformed to XLink 1.0 documents

The following XSLT stylesheet transforms any XLink 1.1 conforming document into an XLink 1.0 conforming document.

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
		xmlns:xlink="http://www.w3.org/1999/xlink"
                version="1.0">

<xsl:preserve-space elements="*"/>

<xsl:template match="/">
  <xsl:apply-templates/>
</xsl:template>

<xsl:template match="*[@xlink:href]">
  <xsl:copy>
    <xsl:copy-of select="@*"/>
    <xsl:if test="not(@xlink:type)">
      <xsl:attribute name="xlink:type">simple</xsl:attribute>
    </xsl:if>
    <xsl:apply-templates/>
  </xsl:copy>
</xsl:template>

<xsl:template match="*">
  <xsl:copy>
    <xsl:copy-of select="@*"/>
    <xsl:apply-templates/>
  </xsl:copy>
</xsl:template>

<xsl:template match="comment()|processing-instruction()|text()">
  <xsl:copy/>
</xsl:template>

</xsl:stylesheet>

DocBook

The DocBook Standard and its implementations already default the xlink:type attribute to “simple”.

SVG

The SVG Recommendation and its implementations already default the xlink:type attribute to “simple” as discussed in its generic description of xlink:type attribute.

Test Suite

There is also an XLink 1.1 Test Collection which contains additional examples.