xaml export can generate invalid Names
Summary:
The Name
property of XAML elements have some restrictions for what is considered valid. From the docs:
The string values used for Name have some restrictions, as imposed by the underlying x:Name Directive defined by the XAML specification. Most notably, a Name must start with a letter or the underscore character (_), and must contain only letters, digits, or underscores. For more information, see WPF XAML Namescopes.
It seems like Inkscape uses the SVG object names for the corresponding XAML element Name, but those names can start with numbers, which generates invalid XAML. Maybe they could be prepended with _
if they start with a number?
Steps to reproduce:
- Download the attached file
- Run
inkscape --export-type="xaml" harpoon.svg
What happened?
A XAML file is successfully exported, but the generated file is invalid since it has a Name
property starting with 0
(021Harpoon
).
What should have happened?
Not sure, but maybe the Name
property can be prepended with an underscore character.
Sample attachments
from https://www.flaticon.com/free-icon/harpoon_2739426?related_id=2739426&origin=pack
Version Info:
- Inkscape Version: Inkscape 1.0.2-2 (e86c870879, 2021-01-15)
- Operating System: Windows 10
- Operating System version: 20H2 (10.0.19042 Build 19042)