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


> 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\")"


on the balkony


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

> If you have suggestions for improvement

.svgz support would be great.


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

This archive was generated by hypermail 2.3.1 : Wednesday, 8 March 2017 09:46:53 UTC