W3C home > Mailing lists > Public > public-xml-core-wg@w3.org > February 2007

XLink conversion stylesheet

From: Norman Walsh <Norman.Walsh@Sun.COM>
Date: Wed, 14 Feb 2007 10:51:13 -0500
To: public-xml-core-wg@w3.org
Message-ID: <871wksspou.fsf@nwalsh.com>
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

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:16:37 UTC