Inkscape export to XAML produces invalid XAML

Bug #220711 reported by migueldeicaza
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Medium
jazzynico

Bug Description

Inkscape currently produces markup that includes things like "1px" which is invalid XAML, for example:

inside <Path> you generate StrokeThickness="1px"

Tags: exporting xaml
Revision history for this message
Marcin Floryan (mfloryan) wrote :

Also see Bug #215534.

tags: added: xaml
su_v (suv-lp)
tags: added: exporting
Revision history for this message
su_v (suv-lp) wrote :

not reproduced with Inkscape 0.47 r22583 on OS X 10.5.8:

    <rect
       style="fill:none;fill-opacity:0.75294117999999999;stroke:#000000;stroke-opacity:1;stroke-width:10"
       id="rect3003"
       width="300"
       height="300"
       x="50"
       y="50" />

is export to XAML as

<Rectangle xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Canvas.Left="50" Canvas.Top="50" Width="300" Height="300" Name="rect3003" Stroke="#FF000000" StrokeThickness="10"/>

Revision history for this message
su_v (suv-lp) wrote :

Do you still see incorrect markup when exporting SVG to XAML with the current release version (Inkscape 0.47)?

Changed in inkscape:
status: New → Incomplete
Revision history for this message
jazzynico (jazzynico) wrote :

Reproduced on Windows XP, Inkscape 0.47, with a pencil drawing:

    <path
       style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
       d="m .......

is exported as:

<Path xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Name="path3592" Stroke="#FF000000" StrokeThickness="1px" StrokeLineJoin="Miter" StrokeStartLineCap="Flat" StrokeEndLineCap="Flat" Data="m ...

The XSL transformation doesn't take the unit into account and copies the whole SVG attribute value to the XAML attribute.
I mark it confirmed, but I'm not sure if attributes is still invalid in XAML (and the *specs* I've found are very hard to read...). Miguel, could you please confirm it?

Changed in inkscape:
status: Incomplete → Confirmed
Revision history for this message
migueldeicaza (miguel-ximian) wrote :

What do you want me to confirm?

yes, "1px" is invalid.

The properties can be looked up on MSDN by going to the System.Windows.Shapes.Path class, and its parent class System.Windows.Shapes.Shape class.

There you can find all of the properties that are exposed, for example:

http://msdn.microsoft.com/en-us/library/system.windows.shapes.shape.strokethickness(VS.95).aspx

jazzynico (jazzynico)
Changed in inkscape:
importance: Undecided → Medium
jazzynico (jazzynico)
Changed in inkscape:
assignee: nobody → JazzyNico (jazzynico)
status: Confirmed → In Progress
Revision history for this message
jazzynico (jazzynico) wrote :

Fix committed in bzr revision 9397.
Units are now removed, and values converted to pixels.
I've also followed MSDN's suggestion to round values to pixels.

Changed in inkscape:
milestone: none → 0.48
status: In Progress → Fix Committed
Revision history for this message
jazzynico (jazzynico) wrote :

The fix can be tested by replacing svg2xaml.xsl (in the share/extensions folder) by the attached file.

jazzynico (jazzynico)
Changed in inkscape:
status: Fix Committed → Fix Released
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.