Version 5.0.3 under Linux, was also able to reproduce it in 4.6.4 under Linux
This script (I tried to make it as simple as possible) produces bad XML (output terminal is set to SVG):
#!/usr/local/bin/gnuplot
output_file = "test.svg"
set terminal svg
set output output_file
plot [0:10] [0:2] 1
plot [0:10] [0:2] 1.5
Then in terminal:
$ xmllint test.svg
test.svg:232: parser error : Opening and ending tag mismatch: svg line 4 and g
</g>
^
test.svg:233: parser error : Extra content at the end of the document
</svg>
^
Removing the second "plot" command fixes the problem.
The script is also attached for your convenience.
Thank you.
Duplicate report: See tracker items #1298, #1397
Short answer: Gnuplot output is normally one plot per page. You cannot put two separate pages into a single svg output file. You can, however, use "set multiplot" to produce a single page that just happens to hold two plots.