W3C home > Mailing lists > Public > www-svg@w3.org > January 2004

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

From: Helder Ferreira <hfilipe@fe.up.pt>
Date: Thu, 22 Jan 2004 07:48:18 -0000
Message-ID: <010601c3e0bc$1dbcc5d0$476aa8c0@lpfhff>
To: "Samuel Goldenbaum" <samuel@3hgroup.com>, <www-svg@w3.org>
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;

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. .



  ----- 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



  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?




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

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