Inkscape.org
Using Inkscape with Other Programs Inkscape does not retain edited id and custom attributes inside <tspan> after saving
  1. #1
    cusna cusna @cusna

    Hi all,

    I’m working with Inkscape to create .svg files used in an OpenHAB-based UI.
    For compatibility with OpenHAB, text elements must include a <tspan> and custom attributes like openhab="true".

    Here’s the issue I’m encountering:

    1. I create a simple SVG with a <rect> and a <text> element (which automatically includes a <tspan>).

    2. Using the XML editor in Inkscape, I:

      • Change the id of the <rect> and the <tspan>.

      • Add a custom attribute openhab="true" inside the <tspan>.

    3. I save the file.

    However, when I reopen the SVG or check the file with an external text editor:

    • The id change on the <rect> is correctly saved.

    • But the <tspan> element:

      • Still has the original id assigned by Inkscape.

      • Does not include the openhab="true" attribute I added.

    It looks like Inkscape discards manual changes to <tspan> elements upon saving.
    This behavior breaks our workflow with OpenHAB.

    Is this a known issue? Is there a workaround to force Inkscape to retain manual edits inside <tspan>?

    Thanks in advance for any suggestions or explanations.

  2. #2
    Tyler Durden Tyler Durden @TylerDurden
    *

    The SVG validator flags that use of attribute as invalid.

    https://validator.w3.org/check

     

    My test file is attached.

     

    Tspan1
Inkscape Inkscape.org Inkscape Forum Using Inkscape with Other Programs Inkscape does not retain edited id and custom attributes inside <tspan> after saving