Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Simple modification to SVG

by kcott (Abbot)
on Sep 04, 2013 at 10:50 UTC ( #1052286=note: print w/ replies, xml ) Need Help??


in reply to Simple modification to SVG

SVG is an XML application. Choose a module that can manipulate XML files and perform the necessary changes.

The module you pick may be dependent on what you're familiar with. I'd probably choose XML::LibXML because that's what I'm familiar with. You can search CPAN for modules in the XML:: namespace: there's a lot to choose from (and not all of them applicable to your current requirements).

From the limited information you've provided regarding the replacement, it appears that certain rect element attribute values need to be used (possibly after some manipulation) as image element attribute values. This looks straightforward, e.g. $href = substr($fill, 1) . '.svg', but come back and ask if you run into difficulties. [To get the best answers, follow the guidelines in "How do I post a question effectively?"]

-- Ken


Comment on Re: Simple modification to SVG
Select or Download Code
Re^2: Simple modification to SVG
by hackmare (Pilgrim) on Dec 31, 2013 at 19:08 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1052286]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (7)
As of 2014-10-25 09:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (142 votes), past polls