[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: SVG paths in XSLT (was: Using W3C Regular Expressions)
- From: email@example.com (Henry S. Thompson)
- To: Robin Berjon <firstname.lastname@example.org>
- Date: Fri, 20 Apr 2001 14:59:04 +0100
Robin Berjon <email@example.com> writes:
> At 10:17 20/04/2001 +0100, Henry S. Thompson wrote:
> >Robin Berjon <firstname.lastname@example.org> writes:
> >> Size otoh is not really a good argument. Gz-compressed SVG is really small
> >> (smaller than the other vector graphic formats that I've benchmarked it
> >> against), and it wouldn't be much larger if paths used markup instead.
> >> However, SVG paths wouldn't be much more humanly readable as markup than
> >> they are as strings so that point is pretty moot in the context of SVG
> >Disagree -- if they used markup I could use XSL(T) on them, which I
> >would really like to do!
> I was just addressing the points that had been listed, ie readability and
> size. I wholeheartedly agree that being able to transform some path
> vocabulary into SVG using XSLT is very interesting. As things stand now, I
> don't think that it is impossible however.
> Given the following vocabulary:
> <moveto position='absolute' x='100' y='150' />
> <lineto position='relative' x='80' y='10' />
> <horizontal-lineto position='absolute' x='200' />
> <closepath />
> to be transformed into <path d='M 100 150 l 80 90 H 200 z' /> (if my SVG
> isn't too rotten), the following XSLT seems to do the job (in Saxon):
Right -- I wanted to be able to go _the other way_, and without
_deeply_ tedious us of string functions and so in in XSLT I can't.
I agree that in principle the move we want to encourage is _out of_
other formats _into_ SVG, as you've done, but sometimes the other way
is necessary, and the actual application I had in mind was for
tutorial _display_ of SVG paths, i.e. SVG->HTML.
Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
W3C Fellow 1999--2001, part-time member of W3C Team
2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
Fax: (44) 131 650-4587, e-mail: email@example.com