469,322 Members | 1,583 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,322 developers. It's quick & easy.

image/svg+xml

i am trying to create dynamic svg-images by using asp. i dont use any doctype.
first lines of my asp-file are

Response.ContentType = "image/svg+xml".
Call Response.Write("<?xml version=""1.0"" encoding=""UTF-8""?>")

after these lines i wrote the svg-code. this doesn't work using internet
explorer but in firefox it works. so i thried to use php. first lines in php
are

header("Content-Type: image/svg+xml");
echo '<?xml version="1.0" encoding="UTF-8"?>';

after these lines i wrote the svg-code. this works using both browsers. so i
need someone who is able to show me how to get this run on both browsers using
asp.

Dec 20 '07 #1
2 3061
Markus wrote on Thu, 20 Dec 2007 06:20:23 +0100:
i am trying to create dynamic svg-images by using asp. i dont use any
doctype.
first lines of my asp-file are
Response.ContentType = "image/svg+xml".
Call Response.Write("<?xml version=""1.0"" encoding=""UTF-8""?>")
after these lines i wrote the svg-code. this doesn't work using
internet explorer but in firefox it works. so i thried to use php.
first lines in php are
header("Content-Type: image/svg+xml");
echo '<?xml version="1.0" encoding="UTF-8"?>';
after these lines i wrote the svg-code. this works using both browsers.
so i need someone who is able to show me how to get this run on both
browsers using asp.
Is there anything before those lines in your ASP code? IE is dependent upon
having no empty space before the XML, eg.
<%
'do some ASP stuff here
%>
<%
Response.ContentType = "image/svg+xml".
Call Response.Write("<?xml version=""1.0"" encoding=""UTF-8""?>")
%>

will result in a blank line appearing before the XML header. What you need
to do is strip out any whitespace above where you start outputting the XML,
eg.

<%
'do some ASP stuff here
%><%
Response.ContentType = "image/svg+xml".
Call Response.Write("<?xml version=""1.0"" encoding=""UTF-8""?>")
%>

the simple removal of that blank line makes a big difference.

If you provide all the ASP page content up to where you write out the first
XML line then it might make it easier to see where the issue is.

--
Dan
Dec 21 '07 #2
"Daniel Crichton" <ms****@worldofspack.comwrote in message
news:Ou**************@TK2MSFTNGP05.phx.gbl...
Markus wrote on Thu, 20 Dec 2007 06:20:23 +0100:
i am trying to create dynamic svg-images by using asp. i dont use any
doctype.
first lines of my asp-file are
Response.ContentType = "image/svg+xml".
Call Response.Write("<?xml version=""1.0"" encoding=""UTF-8""?>")
after these lines i wrote the svg-code. this doesn't work using
internet explorer but in firefox it works. so i thried to use php.
first lines in php are
header("Content-Type: image/svg+xml");
echo '<?xml version="1.0" encoding="UTF-8"?>';
after these lines i wrote the svg-code. this works using both browsers.
so i need someone who is able to show me how to get this run on both
browsers using asp.

Is there anything before those lines in your ASP code? IE is dependent
upon
having no empty space before the XML, eg.
<%
'do some ASP stuff here
%>
<%
Response.ContentType = "image/svg+xml".
Call Response.Write("<?xml version=""1.0"" encoding=""UTF-8""?>")
%>

will result in a blank line appearing before the XML header. What you need
to do is strip out any whitespace above where you start outputting the
XML,
eg.

<%
'do some ASP stuff here
%><%
Response.ContentType = "image/svg+xml".
Call Response.Write("<?xml version=""1.0"" encoding=""UTF-8""?>")
%>

the simple removal of that blank line makes a big difference.

If you provide all the ASP page content up to where you write out the
first
XML line then it might make it easier to see where the issue is.
My testing with FF3 shows it to be equally sensitive to any preceeding
whitespace, which is reasonable since that would be a breach of the spec.

I suggest using fiddler to determine exactly what is being sent by PHP and
comparing that with the ASP version. This could be a character encoding
problem.
--
Anthony Jones - MVP ASP/ASP.NET
Dec 22 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by Karthik | last post: by
reply views Thread by kevin gordon | last post: by
3 posts views Thread by Tripredacus-X | last post: by
7 posts views Thread by mjarends | last post: by
1 post views Thread by Zhang Weiwu | last post: by
4 posts views Thread by Glenn | last post: by
1 post views Thread by dariophoenix | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by Gurmeet2796 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.