W3C home > Mailing lists > Public > www-svg@w3.org > October 2002

Re: Error in SVG 1.1 CR 6.6?

From: Dean Jackson <dean@w3.org>
Date: Fri, 25 Oct 2002 22:04:41 +1000
To: AndrewWatt2001@aol.com
Cc: www-svg@w3.org
Message-ID: <20021025120441.GA6970@grorg.org>

On Fri, 25 Oct 2002, AndrewWatt2001@aol.com wrote:

> The XSLT stylesheet shown in 6.6 does not produce the output shown, at least 
> it doesn't using Instant Saxon 6.5.2.

Correct. Here is (one example of) a fixed version. Tested with xsltproc.

<?xml version="1.0" standalone="no"?>
<xsl:stylesheet version="1.0"

<xsl:output method="xml"
    doctype-public="-//W3C//DTD SVG 1.1//EN"

<!-- Add version to topmost 'svg' element -->
<xsl:template match="/svg:svg">
    <xsl:copy-of select="@*"/>
    <xsl:attribute name="version">1.1</xsl:attribute>

<!-- Add styling to all 'rect' elements -->
<xsl:template match="svg:rect">
    <xsl:copy-of select="@*"/>
    <xsl:attribute name="fill">red</xsl:attribute>
    <xsl:attribute name="stroke">blue</xsl:attribute>
    <xsl:attribute name="stroke-width">3</xsl:attribute>

<!-- default is to copy input element -->
<xsl:template match="*|@*|text()">
    <xsl:apply-templates select="*|@*|text()"/>

Received on Friday, 25 October 2002 08:04:54 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:53:55 UTC