I've done this and it worked for me.
But I think there should be the mysterious //<!\[CDATA\[
stuff:
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC
"-//W3C//DTD SVG 1.1//EN"
"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="200"
height="200"
zoomAndPan="disable"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xml:space="preserve">
<!-- Script linked from the outside-->
<script xlink:href="linked_script.js" />
<script>
//<![CDATA[
alert("ble");
]]>
</script>
</svg>
This is the file I embed it in (and it alert
s as expected):
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="generator" content="PSPad editor, www.pspad.com">
<title>Svg embeding test</title>
</head>
<body>
<embed src="test.svg" type="image/svg+xml" />
</body>
</html>