svg symbol id fails with percent-encoded symbols

Bug #1737778 reported by Erik Demaine
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Invalid
Undecided
Unassigned

Bug Description

Attached is a simple example of SVG that uses percent-encoded symbols in a <symbol id>. Inkscape ignores the object upon import. Changing the <symbol id> (and corresponding <use xlink:href>) to an ASCII string like "space" causes the example to work (produce a black square in the middle of the canvas).

I was originally using 0.91.1, but tested again on 0.92.2 and found the same behavior.

As far as I can tell, <symbol id>s should follow the IRI spec of https://tools.ietf.org/html/rfc3987 which allows percent-encoded characters.

Tags: symbols
Revision history for this message
Erik Demaine (edemaine) wrote :
Patrick Storz (ede123)
tags: added: symbols
removed: svg
Revision history for this message
Jonathan Hofinger (jhofinger) wrote :

Nope, that's not valid. Browsers also don't render the file. That's because
Additional requirements apply in order for the ‘id’ attribute to be valid in XML documents, as defined in the specification for the relevant version of XML. A stand-alone SVG document uses XML 1.0 syntax [xml], which specifies that valid ‘id’ values are XML name tokens (https://www.w3.org/TR/SVG2/struct.html#Core.attrib) and https://www.w3.org/TR/xml/#NT-Name lists the allowed characters for the first and subsequent letters of an ID.

The % sign is U+0025, and can not be included in an ID.

Please reopen at http://inkscape.org/report if you encounter similar issues.

Closed by https://gitlab.com/jhofinger

Changed in inkscape:
status: New → Invalid
Revision history for this message
Erik Demaine (edemaine) wrote :

Thank you very much for pointing me to the correct spec! I will follow this much more restrictive spec when generating SVG.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.