image/svg+xml

Discussion in 'ASP General' started by Markus Olderdissen, Dec 20, 2007.

  1. 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.
     
    Markus Olderdissen, Dec 20, 2007
    #1
    1. Advertising

  2. 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
     
    Daniel Crichton, Dec 21, 2007
    #2
    1. Advertising

  3. "Daniel Crichton" <> wrote in message
    news:...
    > 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
     
    Anthony Jones, Dec 22, 2007
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Arne Nordmann
    Replies:
    0
    Views:
    535
    Arne Nordmann
    Jun 28, 2004
  2. Mardagg
    Replies:
    0
    Views:
    811
    Mardagg
    May 12, 2006
  3. Mardagg
    Replies:
    0
    Views:
    674
    Mardagg
    May 12, 2006
  4. milof83

    svg to svg saving problem

    milof83, Aug 18, 2006, in forum: Java
    Replies:
    1
    Views:
    838
    Roland de Ruiter
    Aug 18, 2006
  5. Helmut Jarausch

    Re: svg-chart 1.1 SVG Charting Library

    Helmut Jarausch, May 20, 2008, in forum: Python
    Replies:
    0
    Views:
    476
    Helmut Jarausch
    May 20, 2008
Loading...

Share This Page