Re: SVG --> HTML/TXT for searching and accessibility

Dean,

> I'm pleased to announce an online service to extract the
> text and metadata from SVG files and output the results
> as either text or HTML.
> 
> http://www.w3.org/2002/05/svg2stuff.html


Good stuff :)


> Alternatively, you could write a program that
> ignores everything within angle brackets (bonus points to
> anyone who can do this in a program of 25 characters or
> less!)


Just oneliners:

---25(the two \s would not be needed in a file)---
C:\>ruby -e "s='<svg><title>granny</title><desc>on the 
balkony</desc><text>2002</text><g/></svg>'; puts s.gsub(/<.+?>/,\"\n\")"

granny

on the balkony

2002
---

---25---
C:\>ruby -e "s='<svg><title>granny</title><desc>on the 
balkony</desc><text>2002</text><g/></svg>'; puts s.scan(/>([^<]+?)</)"
granny
on the balkony
2002
---


> If you have suggestions for improvement


.svgz support would be great.


Tobi


-- 
http://www.pinkjuice.com/

Received on Wednesday, 12 June 2002 04:14:23 UTC