Problem with SVG: AttValue: " or ' expected

Viewed 3196

I'm studying SVG images for the first time, I'm following an online guide (link is in Italian, but if you're interested it's this:https://www.html.it/pag/31776/le-figure-geometriche-principali/ ) But I have some problems that I can't solve.

I'm trying to insert simple geometric shapes in my svg file, but I always get this error message, even if I insert the shapes one at a time:

This page contains the following errors: error on line 8 at column 11: AttValue: " or ' expected Below is a rendering of the page up to the first error.

The code I'm trying is this:

<?xml version="1.0" encoding="iso-8859-1" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//Dtd SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/Dtd/svg11.dtd">

<svg width="800" height="600" viewBox="0 0 800 600" preserveAspectratio="xMinYMin" enable-background="new 0 0 800 600"
     version="1.1" xmlns="http://www.w3.org/2000/svg">

    
    <line x1=”10" y1=”10" x2=”100" y2=”100" style=”stroke:red”/>
    
    <polyline points=”30,30 50,50 90,10" style=”stroke:red;fill:none”/>
    
    <circle cx=”100" cy=”100" r=”50" style=”stroke:red;fill:#ff00ee”/>
    
    <rect x=”10" y=”10" rx=”2" ry=”2" width=”100" height=”50" style=”fill:red”/>
    
    <ellipse cx=”100" cy=”100" rx=”70" ry=”50" style=”fill:red”/
    
             </svg>

Where is the mistake? How can I solve?

Please remember that I have just started studying, try to explain as if I were a child XD

Thanks a lot!

1 Answers

As already mentioned in the comments, you used two single quotes instead of a double quote "

In the code below, single quotes are replaced with double quotes. The error message is no longer displayed

<svg version="1.1" xmlns="http://www.w3.org/2000/svg" 
    xmlns:xlink="http://www.w3.org/1999/xlink">
<line x1="10" y1="10" x2="00" y2="100" style="stroke:red"/>

<polyline points="30,30 50,50 90,10" style="stroke:red;fill:none"/>

<circle cx="100" cy="100" r="50" style="stroke:red;fill:#ff00ee"/>

<rect x="10" y="10" rx="2" ry="2" width="100" height="50" style="fill:red"/>

<ellipse cx="100" cy="100" rx="70" ry="50" style="fill:red"/>

</svg>

Related