Re: How do I view a string of SVG xml in a html page

You can create a CGI script that takes the SVG code and prints a new document with mime type: image/svg+xml

Example in Perl:

use CGI;
my $q = new CGI;
if ($q->param()) {  $svg_code_in_textarea = $q->param('svg_code'); }

print $q->header(-type=>'image/svg+xml');
print <<EndHTML;
$svg_code_in_textarea
EndHTML

Note:
When you use the script, add something with the svg extension.
Example: http://my.site/cgi-bin/svg.cgi?x.svg .
If you don't put the svg, it won't work in I.E. .

Regards,

    Helder

  ----- Original Message ----- 
  From: Samuel Goldenbaum 
  To: www-svg@w3.org 
  Sent: Thursday, January 22, 2004 4:00 AM
  Subject: How do I view a string of SVG xml in a html page


  HI

   

  I have a textarea where users paste svg/xml text into. I would like to let them preview the SVG without having to create a actual file from it.

   

  How do I do this?

   

  Thanks,

   

  S

Received on Thursday, 22 January 2004 02:48:41 UTC