Opened 9 years ago

Last modified 3 years ago

#11427 assigned enhancement

Incremental Improvements to svg2gfx.xsl

Reported by: Feneric Owned by: Feneric
Priority: low Milestone: 1.15
Component: DojoX GFX Version: 1.5.0b2
Keywords: GFX Cc:
Blocked By: Blocking:

Description

I have attached a patch to svg2gfx.xsl that removes some of the unnecessary trailing commas left by the conversion. It does not (yet) remove all of them, just the simple cases with elements.

Attachments (3)

svg2gfx.patch (8.2 KB) - added by Feneric 9 years ago.
patch for svg2gfx.xsl
svg2gfx.xsl (44.2 KB) - added by Eugene Lazutkin 9 years ago.
The original file.
test2.svg (2.0 KB) - added by tcrass 7 years ago.
When transformed, results in missing comma between the path's fill and style attribute

Download all attachments as: .zip

Change History (13)

Changed 9 years ago by Feneric

Attachment: svg2gfx.patch added

patch for svg2gfx.xsl

comment:1 Changed 9 years ago by Eugene Lazutkin

Milestone: tbd1.5

For some reason the patch file is 0 bytes. Please send it to me directly (or the whole file --- whatever is easier).

comment:2 Changed 9 years ago by bill

I think the patch file is valid, it's just that it doesn't show up in the formatted view... that's a problem sometimes with [our] trac instance. If you download the patch in the raw format (original format link after following the above link), I think it will work.

comment:3 in reply to:  2 Changed 9 years ago by Eugene Lazutkin

Status: newassigned

Replying to bill:

If you download the patch in the raw format (original format link after following the above link), I think it will work.

Did you try to download it? Could you?

comment:4 Changed 9 years ago by bill

Oops, you are right, it downloads as zero size. Nevermind.

Changed 9 years ago by Eugene Lazutkin

Attachment: svg2gfx.xsl added

The original file.

comment:5 Changed 9 years ago by Eugene Lazutkin

Resolution: fixed
Status: assignedclosed

(In [22471]) gfx: replaced the resource XSL file to reduce number of stray commas, thx Eric W. Brown!, !strict, fixes #11427.

comment:6 Changed 8 years ago by John Locke

Resolution: fixed
Status: closedreopened

This patch generates an invalid JSON file, if there is a transform on a group.

Starting around line 792, the test for last has the wrong context -- if this is the last child of the svg element, and it is a <g> element, and the <g> has a transform attribute, the comma gets omitted after the "children" object, before the "transform" item.

Also, there are still a lot of stray trailing commas that get generated by this xslt file, which break IE7. My temporary fix was to add the comma back to this item, and then use sed to strip out all the stray commas immediately before } or ].

comment:7 Changed 8 years ago by Eugene Lazutkin

Milestone: 1.5future

comment:8 Changed 7 years ago by tcrass

Hi,

just encountered another incarnation of the "over-shooting comma removal" issue mentioned by freelock two postings above -- the attached file's processing output is invalid because in the generated JSON, the first (and only) SVG path's stroke attribute gets appended to the (correctly transformed) fill attribute, but *without* a comma to separate the two of them.

Changed 7 years ago by tcrass

Attachment: test2.svg added

When transformed, results in missing comma between the path's fill and style attribute

comment:9 Changed 3 years ago by dylan

Milestone: future1.12
Owner: changed from Eugene Lazutkin to Feneric
Status: reopenedassigned

@Feneric, do you care to revisit this (I know it's been eons), to address some of the regressions that were introduced?

comment:10 Changed 3 years ago by dylan

Milestone: 1.131.15

Ticket planning... move current 1.13 tickets out to 1.15 to make it easier to move tickets into the 1.13 milestone.

Note: See TracTickets for help on using tickets.