XLink conversion stylesheet

I believe this XSLT 1.0 stylesheet converts XLink 1.0 to XLink 1.1:

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

<xsl:output method="xml"/>

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

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

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


Note that this does the right thing for XLink 1.0 documents that rely
on defaulted attributes in the DTD because they will automatically be
preserved. (The DTD will add them so XSLT will see them so XSLT will
write them out.)

                                        Be seeing you,

Norman Walsh
XML Standards Architect
Sun Microsystems, Inc.

Received on Wednesday, 14 February 2007 15:51:48 UTC