logo       

Re: RFC: Idea for Dummy Display: msg#00044

Subject: Re: RFC: Idea for Dummy Display
Dean Arnold <darnold@xxxxxxxxxxxxxx> writes:

> Jack D. wrote:
> > Holy moly - Now I see why you are confused! Effectively - that is
> > something
> > like what I'm talking about.
> > I see that having an SVG->Canvas converter and a Canvas->SVG would
> > definitely be an asset. One could draw a picture (using another graphics
> > tool) - save it in SVG format and then have it plotted on a Tk::Canvas. That
> > being said - my driving force behind this, was not to *store* a canvas - but
> > rather to *plot* canvas items by reading the data from outside the program!
> > But now I see that they are one in the same thing. The analogy is to store a
> > file and read a file, the former must be done before the latter - duh! Ala
> > said it succinctly - a "persistent canvas". I see that Slaven has such a
> > utility in his CanvasUtil.pm module using storable.
> >
> 
> 1) There are already some SVG generators available on CPAN
> (GD::SVG, plus a couple others). That part should be
> fairly simple to wrap in a Tk->SVG converter.
> 
> 2) The other way round (SVG->Canvas) may be a bit more
> challenging, tho theoretically some sort of XSLT might
> produce Perl/Tk code from an SVG input ?
> 

Not only theoretically, see the both attachments. The stylesheet is
the result of a little bit playing around with xslt and svg, nothing
really serious. You can try it out with a xslt processor like xsltproc:

        xsltproc svg.xsl test.svg | perl -

But I am not sure that Jack needs some kind of XML solution. Why bot
using just Perl?

| item of type PIREP is a triangle
| item of type UNOFFICIAL OB is a circle
| item of type SWED is a square

would map into a hash (item type => canvas type)

| if header contains UACN or UBUS then
|   set item type to PIREP
| otherwise if header contains SXCN then
|   set item type to UNOFFICIAL OB
| otherwise if header contains SWED then
|   set item type to SWED
| End

would also map into a hash (header => item type) or maybe a list of
regular expressions mapped to item types. These hashes could be moved
out of the application into a .pl or .pm file which means that parsing
would be done with a simple "require" or "do" call --- no external XML
parsers needed. Processing data would be quite natural --- no complex
DOM operations or non-intuitive handling with XML::Parser necessary.

Regards,
        Slaven

Attachment: svg.xsl
Description: Binary data

Attachment: test.svg
Description: Binary data



-- 
Slaven Rezic - slaven <at> rezic <dot> de

Tk-AppMaster: a perl/Tk module launcher designed for handhelds
        http://tk-appmaster.sf.net
<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
science.linguis...    culture.sf.lite...    video.mplayer.c...    yellowdog.gener...    ietf.rfc822/199...    emacs.help/2002...    redhat.release....    kernel.speakup/...    java.openejb.de...    debian.devel.gt...    xfree86.newbie/...    bug-tracking.ma...    pam/2003-05/msg...    games.devel.ope...    user-groups.lin...    music.pancham/2...    network.mq.deve...    web.html.genera...    arklinux.bugs/2...    linux.ecasound/...    qnx.openqnx.dev...    org.user-groups...    file-systems.sf...    trustix.contrib...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe