Hi André, You nailed it. My cgi program was creating the svg file and I forgot to close the file handle. (facepalm)
Thanks for the help. Bill On Sat, Nov 13, 2010 at 10:39 AM, André Warnier <a...@ice-sa.com> wrote: > 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 ? > > >