LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-12-2007, 05:47 PM   #1
cyb0rg777
Member
 
Registered: Dec 2004
Location: ~
Distribution: Debian
Posts: 143
Blog Entries: 8

Rep: Reputation: 15
perl xml svg


I have this perl script I am trying to run from apache.
It works outside of the server.Other scripts are running ok on the server.
Code:
#!/usr/bin/perl -w
use strict;
use XML::Writer;

my $image_height = 60;
my $image_width = 200;

my $writer = XML::Writer->new();
$writer->xmlDecl('UTF-8');
$writer->doctype('svg','-//W3C//DTD SVG 20001102//EN',
'http://www.w3.org/TR/2000/CR-SVG-20001102/DTD/svg-20001102.dtd');

$writer->startTag('svg',
                   height => $image_height,
                   width  => $image_width);

$writer->emptyTag('rect',
                   height => $image_height,
                   width  => $image_width,
                   fill   => '#005580');

$writer->startTag('g',
                   id => 'mainGroup',
                   transform => 'translate(24,42)',
                   style => 'font-size:42;font-weight:bold;');

$writer->dataElement('desc',
                     'JAPH with an XML twist. Features a simple drop shadow.');

$writer->startTag('text',
                   transform => 'translate(3, 3)',
                   style => 'fill:#003955');

$writer->characters('<japh/>');
$writer->endTag('text');

$writer->startTag('text',
                   style => 'fill:#FFFFFF');
$writer->characters('<japh/>');
$writer->endTag('text');
$writer->endTag('g');
$writer->endTag('svg');
$writer->end();
When I try to open the file from the server I get this log error.

malformed header from script. Bad header=<?xml version="1.0" encoding=": /svg.pl

I can't figure this error out.
 
Old 09-13-2007, 02:42 AM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,356

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
If nobody can help here, try www.perlmonks.org
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
checking for XML::Parser... configure: error: XML::Parser perl module is required for kornerr Linux - General 11 11-16-2008 07:24 AM
Need advice on xml svg image editor. cyb0rg777 Programming 2 08-12-2007 04:10 AM
XML and Perl msvinaykumar Programming 3 08-08-2006 08:16 AM
Perl XML and RE's PB0711 Programming 8 07-25-2006 06:57 PM
dynamic SVG (php) on firefox: this XML blah blah eantoranz Programming 1 03-17-2006 11:58 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:59 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration