XSLT handling from a POST

Matthew Graham mjg at cacr.caltech.edu
Fri Sep 18 23:34:49 PDT 2009


It turns out that XMLHttpRequest does not respect xml-stylesheet or,  
indeed, any other processing instructions in the response from the  
server. One has to manually apply the stylesheet in Javascript to the  



On Sep 18, 2009, at 5:39 PM, Matthew Graham wrote:

> Hi,
> I have a XML document which I am serving to a web browser and  
> including a processing instruction so that the browser applies an  
> XSLT to the document to format it correctly. Now this works fine for  
> my first page which is retrieved via an HTTP GET. Now this is a form  
> and the next page is returned as a result of the HTTP POST that the  
> form initiates.
> The next page is also an XML document with the same processing  
> instruction to invoke an XSLT but none of the browsers I have tried  
> (Firefox 3.5, Safari 4, Opera 10) apply the XSLT and just render it  
> as XML. I am even setting the Content-Type of the response to   
> "application/xhtml+xml' to try and invoke a XSLT but this is not  
> working.
> Does anyone know a workaround/solution for this?
> 	Cheers,
> 	Matthew

More information about the apps mailing list