XML Content Type

J

Jim

Does anyone know why Response.AddHeader "Refresh" does not work when
Response.ContentType = "text/xml"?

The code is very short:
<%
Response.ContentType = "text/xml"
Response.AddHeader "Refresh", "5;URL=http://localhost/ReturnXML2.asp"
%>
<CiscoIPPhoneImage>
<LocationX>-1</LocationX>
<LocationY>-1</LocationY>
<Width>125</Width>
<Height>23</Height>
<Data>Hex GUID goes here</Data>
<Title>The XYZ Company</Title>
</CiscoIPPhoneImage>

If I change the contentType to "text/plain", the page does refresh/redirect
but not when the ContentType is XML. It needs to be in XML for Cisco Call
Manager.

There is documentation out there that makes it seem like executing the above
code is no problem but I can't get it to refresh/redirect. Can anyone shed
any light?
 
A

Anthony Jones

Jim said:
Does anyone know why Response.AddHeader "Refresh" does not work when
Response.ContentType = "text/xml"?

The code is very short:
<%
Response.ContentType = "text/xml"
Response.AddHeader "Refresh", "5;URL=http://localhost/ReturnXML2.asp"
%>
<CiscoIPPhoneImage>
<LocationX>-1</LocationX>
<LocationY>-1</LocationY>
<Width>125</Width>
<Height>23</Height>
<Data>Hex GUID goes here</Data>
<Title>The XYZ Company</Title>
</CiscoIPPhoneImage>

If I change the contentType to "text/plain", the page does refresh/redirect
but not when the ContentType is XML. It needs to be in XML for Cisco Call
Manager.

There is documentation out there that makes it seem like executing the above
code is no problem but I can't get it to refresh/redirect. Can anyone shed
any light?

The refresh header is a directive to the HTML browser (that browsers aren't
obligated to implement) it isn't a header defined by the HTTP protocol.
When using text/plain the browser assumes responsibility for rendering the
content (IE treats it as HTML). Since the content it is rendering has a
refresh header attached it puts it into action.

However when the content is text/xml the browser isn't actually rendering
the XML. It uses the <?xml-stylesheet processing instruction in the xml
document to transform the XML to content it should render. If that PI isn't
present is uses a default transform. After the transform the content it is
actually rendering no long has a refresh header associated with it so
nothing happens.

Cisco call manager that consumes your XML content would have to be coded to
honor the refresh header.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,264
Messages
2,571,065
Members
48,770
Latest member
ElysaD

Latest Threads

Top