definitions like filters and path-effects not correctly included with <use> tag

Bug #1548126 reported by Michel Racic
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
New
Undecided
Unassigned

Bug Description

When using the <use> tag and xlink:href to reference another svg document, definitions don't get referenced correctly.

The include itself works, the svg gets embedded but in the svg source, a path who references a filter from it's own file gives an error as Inkscape tries to lookup the ID in the main file instead of the included file.

Example:

inc.svg - created with inkscape
 - Create a simple line (path) and apply a blur on it
The relevant svg code after saving will have a filter tag in the defs element with an id.
The path element will have in the style attribute a reference to this id like filter:url(#filter3862)

main.svg
- Create a simple empty document
Open it in a text editor and add a use tag like following inside a layer tag
<use
       xlink:href="inc.svg#layer1"
       height="100%"
       width="100%"
       xlink:show="embed"
       x="0"
       y="0"
       id="testinclude"
       xlink:actuate="onLoad"
       xlink:type="simple" />

Open main.svg in Inkscape and the line will be there but the blur is not applied as the relative idlookup did fail.

Probably inkscape should change relative urls to point accordingly to the full path of the referenced file.
This could be done at runtime for display only and not saved to the file.

Background:
I'm building a document generation system and to reduce maintenance I include object files inside other svg's and the final svgs get rendered to pdfs.
Workaround I have used for me is not clean but works.
I know which defs I need from the collection of source files and just copy pasted the defs into my master template. This template gets used to generate various documents. having the defs in the master file available too makes that it works in Inkscape.

Tags: svg
jazzynico (jazzynico)
tags: added: svg
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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