Re: Defect in "An SVG Primer for Today's Browsers" - syntax errors in example

Thanks, and yes. I have made a note to myself to correct this in the next 
round of updates.

Just fyi, Phil Archer and Doug Schepers and I have actually been making 
exactly some of these corrections over the past few months.... slowly but 
surely! Using this book as the centerpiece of a recent course has sifted out 
lots of impurities!

cheers
David
----- Original Message ----- 
From: "G Be" <gbe8086@yahoo.com>
To: <www-svg@w3.org>
Sent: Wednesday, January 12, 2011 8:33 PM
Subject: Defect in "An SVG Primer for Today's Browsers" - syntax errors in 
example


"Chapter II: SVG Basics"
  "3. Operations: Grouping, Reusing, Scaling, Translation and Rotation"
     "6. use" seems to contain two errors

1.  The example "Reusing code (with modifications) — the <use> tag"
<g fill="black">
<g id="G">

<rect x="100" y="100" width="100" height="20" fill="inherit" />
<rect x="100" y="160" width="100" height="20" fill="inherit" />
<ellipse cx="150" cy="140" rx="30" ry="100" fill="#777" />
<rect x="100" y="130" width="100" height="20" fill="inherit" />

</g></g>
<use xlink:href="G" transform="translate(120,0)" fill="#bbb">

I think the "<use ...>" element is a missing the trailing '/' and should be 
"<use .../>", i.e.
<use xlink:href="G" transform="translate(120,0)" fill="#bbb"/>

2.  The reference 'xlink:href="G"' doesn't work in my browsers (Safari, 
Firefox, Chrome, Opera), but it does work with 'xlink:href="#G"'

Received on Thursday, 13 January 2011 05:18:40 UTC