You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by rob <ro...@btinternet.com> on 2003/06/19 20:43:51 UTC
weird svg problem
Hi,
I have a really strange problem when using svg inside the <object> tag.
When I don't use cocoon to serve the following page everything is fine and I get
an alert, but when cocoon serves the page the javascript fails at getSVGDocument
(or getSvgDocument).
Here is my simple html page :
<html>
<head>
<script>
function initSvg(id) {
var svg = document.getElementById(id);
var svgDoc = svg.getSVGDocument();
alert(svgDoc);
}
</script>
</head>
<body onload="initSvg('svg1')">
<object type="image/svg+xml" id="svg1"
data="test.svgz"
width="100%" height="100%">
</object>
</body>
</html>
Here is a snippet from my sitemap :
<map:match pattern="*.htm">
<map:read src="{1}.htm" mime-type="text/html"/>
</map:match>
<map:match pattern="*.svgz">
<map:read src="{1}.svgz" mime-type="image/svg+xml"/>
</map:match>
This problem does not occurr when I use the <embed> tag - but I prefer
to use <object> so that I can display a jpeg if the SVG plugin is not
installed.
I have tried using cocoon 2.04 and 2.1m2 with the same results.
Any ideas ?
Thanks in advance,
Rob Gregory