Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
I've got a script that generates fairly complicated reports using SVGs as templates. The "master" template is an SVG that contains pointers to additional SVGs that provide the content for the report. These SVGs are generated programatically. The point of the master is to layout the content SVGs on the page. To make editing easy, I use a master template that contains colored boxes instead of links to images. Currently I convert the master template manually. I would like to automate this. How can I replace each line in the template:

<rect x="36" y="36" fill="#0000FF" width="392.4" height="43.2"/>

with:

<image overflow="visible" width="392.4" height="43.2" xlink:href="0000FF.svg" transform="matrix(1 0 0 1 36 36)"></image> ? Additionally, for one particular box, specified by a certain fill color, I would like to read the height so that I can use this to adjust how part of the image generation script functions.

In reply to Simple modification to SVG by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (2)
As of 2024-04-26 00:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found