Upgraded to 20.04 today and, somehow, Document Viewer is not able to open .svg
files. It keeps giving this error. Previously, when I was using 18.04, everything was working fine. No such errors I encountered.
XML parse error: error code=201 (3) in (null):606:15: Namespace prefix xlink for href on image is not defined
EDIT
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
<svg width="200" height="200">
<image id="image0" width="200" height="200" x="0" y="0"
xlink:href="data:image/png;base64
Your document viewer complains about the
svg
file having anxlink
notation somewhere without being declared. As such, yoursvg
file is not a validxml
and the document viewer complains correctly. Maybe in the newer version it is more strict about it.To fix your file open it with an editor and make sure the
xlink
declaration is included in the<svg>
tag in the very beginning of your file, it should look something like this:Update: For your file, change this line:
to this:
See: <svg> - SVG: Scalable Vector Graphics | MDN
It is enough in most cases the
svg
tag to have the following attributes:xmlns
andviewBox
; optionallywidth
andheight
: