Re: XSLT converts svg to shapes with basic transform handling.

2007-10-28 Thread Lars Clausen

On Tue, 2007-07-17 at 15:12 +0100, Sam Liddicott wrote:
 In fact here is a shape I produced of an Extreme Networks 15000
 Summit48.
 I printed page 12 of the Summit Switch hardware installation guide to
 file (postscript) and then converted that to svg with:
 
 pstoedit -f plot-svg /tmp/output.ps  svg/48.svg
 
 I then used inkscape to chop away all the text and extra rubbish and
 label the port connections as connection_XXX and converted that with:
 
 ./genshape svg/48.svg 
 
 The attached shape works fine in dia!

I'm sorry I sat on this so long. I've added a page with your scripts and
example as well as your explanations.  If you or somebody else wants to
clean up the page, it's at http://live.gnome.org/Dia/SvgToShapeXslt.

-Lars


___
Dia-list mailing list
Dia-list@gnome.org
http://mail.gnome.org/mailman/listinfo/dia-list
FAQ at http://live.gnome.org/Dia/Faq
Main page at http://live.gnome.org/Dia



RE: XSLT converts svg to shapes with basic transform handling.

2007-10-28 Thread Sam Liddicott
I'll try and do that.

It's not pefect, I found I also need to scale the stroke width, luckily dia 
ignoes this for now.

Scaling paths is hard because there are so many delimiters of draw operations 
and coordinates and xslt was not written for parsing text.

So I concluded it would be better to just wait till dia more fully supports 
xslt, I.e. The workaround is more work than the fix.

Sam

-Original Message-
From: Lars Clausen [EMAIL PROTECTED]
To: discussions about usage and development of dia dia-list@gnome.org
Sent: 28/10/07 16:59
Subject: Re: XSLT converts svg to shapes with basic transform handling.


On Tue, 2007-07-17 at 15:12 +0100, Sam Liddicott wrote:
 In fact here is a shape I produced of an Extreme Networks 15000
 Summit48.
 I printed page 12 of the Summit Switch hardware installation guide to
 file (postscript) and then converted that to svg with:
 
 pstoedit -f plot-svg /tmp/output.ps  svg/48.svg
 
 I then used inkscape to chop away all the text and extra rubbish and
 label the port connections as connection_XXX and converted that with:
 
 ./genshape svg/48.svg 
 
 The attached shape works fine in dia!

I'm sorry I sat on this so long. I've added a page with your scripts and
example as well as your explanations.  If you or somebody else wants to
clean up the page, it's at http://live.gnome.org/Dia/SvgToShapeXslt.

-Lars


___
Dia-list mailing list
Dia-list@gnome.org
http://mail.gnome.org/mailman/listinfo/dia-list
FAQ at http://live.gnome.org/Dia/Faq
Main page at http://live.gnome.org/Dia


___
Dia-list mailing list
Dia-list@gnome.org
http://mail.gnome.org/mailman/listinfo/dia-list
FAQ at http://live.gnome.org/Dia/Faq
Main page at http://live.gnome.org/Dia



RE: XSLT converts svg to shapes with basic transform handling.

2007-07-20 Thread Sam Liddicott
I've now got a recursive transform apply-er.
It accumulates transforms as it processes svg nodes and applies these to the 
nodes as it goes.
It doesn't yet perform rotates because while rotating a rounded rect is merely 
awkward I haven't worked out how to rotate an ellipse without leaving in the 
transform attribute.

I've also foun I need to scale stroke widths, also that draw strings cann use 
white space to separate coordinates and no white space around draw 
instructions. Parsin that in xslt is a joke.

So can I ask how much will be needed?

It may be easier to support transforms in dia directly...

Sam

-Original Message-
From: Sam Liddicott [EMAIL PROTECTED]
To: discussions about usage and development of dia dia-list@gnome.org
Sent: 17/07/07 15:12
Subject: Re: XSLT converts svg to shapes with basic transform handling.

In fact here is a shape I produced of an Extreme Networks 15000 Summit48.
I printed page 12 of the Summit Switch hardware installation guide to
file (postscript) and then converted that to svg with:

pstoedit -f plot-svg /tmp/output.ps  svg/48.svg

I then used inkscape to chop away all the text and extra rubbish and
label the port connections as connection_XXX and converted that with:

./genshape svg/48.svg

The attached shape works fine in dia!

Sam

* Sam Liddicott wrote, On 17/07/07 13:32:
 This xslt converts svg to shapes and does basic transform handling.

 Skews and rotates are not handled but scales and offsets are.

 Transforms are not handled on groups, but any tag that has a @transform
 attribute will have scaling and offset applied to attributes x, x1, x2,
 y, y1, y2 and also to d, points.

 d, points are handled specially, the attribute value is split on white
 space and anything with a , in it is treated as an x-y pair, with the
 transform done on the x and y pair.

 Sam
 

 ___
 Dia-list mailing list
 Dia-list@gnome.org
 http://mail.gnome.org/mailman/listinfo/dia-list
 FAQ at http://live.gnome.org/Dia/Faq
 Main page at http://live.gnome.org/Dia
   


___
Dia-list mailing list
Dia-list@gnome.org
http://mail.gnome.org/mailman/listinfo/dia-list
FAQ at http://live.gnome.org/Dia/Faq
Main page at http://live.gnome.org/Dia



XSLT converts svg to shapes with basic transform handling.

2007-07-17 Thread Sam Liddicott
This xslt converts svg to shapes and does basic transform handling.

Skews and rotates are not handled but scales and offsets are.

Transforms are not handled on groups, but any tag that has a @transform
attribute will have scaling and offset applied to attributes x, x1, x2,
y, y1, y2 and also to d, points.

d, points are handled specially, the attribute value is split on white
space and anything with a , in it is treated as an x-y pair, with the
transform done on the x and y pair.

Sam


shape2svg.xslt
Description: application/xml
___
Dia-list mailing list
Dia-list@gnome.org
http://mail.gnome.org/mailman/listinfo/dia-list
FAQ at http://live.gnome.org/Dia/Faq
Main page at http://live.gnome.org/Dia