OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SVG paths in XSLT (was: Using W3C Regular Expressions)



Robin Berjon <robin@knowscape.com> writes:

> At 10:17 20/04/2001 +0100, Henry S. Thompson wrote:
> >Robin Berjon <robin@knowscape.com> 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:
> 
> <path>
>  <d>
>    <moveto position='absolute' x='100' y='150' />
>    <lineto position='relative' x='80' y='10' />
>    <horizontal-lineto position='absolute' x='200' />
>    <closepath />
>  </d>
> </path>
> 
> 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):

<snip/>

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.

ht
-- 
  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: ht@cogsci.ed.ac.uk
		     URL: http://www.ltg.ed.ac.uk/~ht/