Google Chrome wont render the XML with xml-stylesheet

The Setup

I am using Flask in debug mode on my local machine & Google Chrome to check on my routes.

The Goal

I would like to render an XML response using this xml stylesheet. The response (incl. the xml-stylesheet tag) looks as follows (checking source in Google Chrome):

<?xml version="1.0" ?><?xml-stylesheet type="text/xsl" href=""?><OAI-PMH xmlns="" xmlns:xsi="" xsi:schemaLocation="">   <responseDate>2020-06-27T17:54:43Z</responseDate>   <request verb="Identify">base_url</request>   <Identify>     <repositoryName>the_project</repositoryName>     <baseURL>base_url</baseURL>     <protocolVersion>2.0</protocolVersion>     <adminEmail>[email protected]</adminEmail>     <earliestDatestamp>2011-01-01T00:00:00Z</earliestDatestamp>     <deletedRecord>persistent</deletedRecord>     <granularity>YYYY-MM-DDThh:mm:ssZ</granularity>     <compression>gzip</compression>     <compression>deflate</compression>   </Identify> </OAI-PMH> 

What Goes Wrong?

However, when looking at the route in Google Chrome (localhost:5000/oai) in my case, I get only raw text output:

2020-06-27T18:01:41Z base_url the_project base_url 2.0 [email protected] 2011-01-01T00:00:00Z persistent YYYY-MM-DDThh:mm:ssZ gzip deflate 

What I Tried

I read that google does not allow reading files from files (e.g. having it in my static folder) due to security reasons, hence I tried to serve the file via Web Server for Chrome plugin. When I go to, I can indeed see the stylesheet.

What am I missing to make this work?


Add Comment
0 Answer(s)

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.