Re: svg/xml being truncated on load?

André Warnier <[email protected]>
Newsgroups gmane.comp.apache.mod-perl
Message-ID <[email protected]>
Hi.

Bill Nelson wrote:
> Hello,
> 
> I am using the CGI.pm module to build a page that includes and embedded 
> svg image:
>    print "\n" . Tr(td({-rowspan=>$leaf_count, -height=>"100%", 
> -width=>"100%"}, "<embed src=\"$tree_file\" width=100% height =100% 
> type=\"image/svg+xml\">"), td(\@data));
> 
> This generates the expected html:
> 
> <tr><td height="100%" rowspan="23" width="100%"><embed 
> src="/tmp/5357.tree.svg" width=100% height =100% 
> type="image/svg+xml"></td> ...
> 
> however I get an xml parse error

where exactly are you "getting" this error ? in the browser calling up the page ?


  instead of my svg image:
> XML Parsing Error: unclosed token
> Location: http://localhost/tmp/1247.tree.svg
> Line Number 59, Column 3:
>                <svg:line x1="100.000%" x2="1
> ----------------^
> 
> The line is intact in the svg/xml file:
> 
>     <svg:line x1="100.000%" x2="100.000%" y1="79.545%" y2="93.182%" />
> 
> and if I paste the source html generated by the program into a file, the 
> page loads without error.
> 
> Does anyone have an idea as to why the xml parse fails when the page is 
> generated, but not when it's static? (Or am I asking the wrong list?)
> 

On the face of it, CGI.pm (and your cgi program) only produce the html page which contains 
a *reference* to the svg file.  It is the browser which then requests this svg file, 
separately, from the server.
The problem you are having, then does not seem to have anything to do with CGI.pm or your 
cgi-bin program per se.
Or, does the cgi-bin program also produce the svg file which the browser retrieves ?
In that case, maybe creating this file is not finished by the time the browser requests it ?
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.