W3C home > Mailing lists > Public > www-svg@w3.org > June 2002

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

From: Tobias Reif <tobiasreif@pinkjuice.com>
Date: Wed, 12 Jun 2002 10:15:10 +0200
Message-ID: <3D07030E.5070707@pinkjuice.com>
To: www-svg@w3.org
CC: dean@w3.org

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 GMT

This archive was generated by hypermail 2.3.1 : Friday, 8 March 2013 15:54:22 GMT