Hi, I want to serve some raw xml files, but add a stylesheet to the response so the user can view it better.
The raw xml begins like this: <chapter xmlns="http://docbook.org/ns/docbook" version="5.0"> etc. </chapter> I want to create some middleware to serve them like this: <?xml version="1.0"?> <?xml-stylesheet type="text/css" href="/media/css/XSL/driver.css" ?> <chapter xmlns="http://docbook.org/ns/docbook" version="5.0"> etc. </chapter> I've got this as a starting point but I have my doubts about it. Even if it works, my guess is it will put an xml-stylesheet as an element, not as a processing instruction. ----------------------------------------- css = '/media/css/XSL/driver.css' class XMLMiddleware(object): def process_response(self, request, response): if request.path.endswith('.xml'): response['xml-stylesheet'] = css return response I haven't wired anything up to test yet; I thought I'd ask if this is the right way to do it before going much further. thanks, --Tim -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

