From: <wol...@us...> - 2006-06-10 20:47:25
|
Revision: 3673 Author: wolfgang_m Date: 2006-06-10 13:47:19 -0700 (Sat, 10 Jun 2006) ViewCVS: http://svn.sourceforge.net/exist/?rev=3673&view=rev Log Message: ----------- REST server: set the Content-Type HTTP header to text/html if a document has an xml-stylesheet processing instruction pointing to an XSLT and no other mime-type is specified via parameters. Modified Paths: -------------- trunk/eXist-1.0/src/org/exist/http/RESTServer.java Modified: trunk/eXist-1.0/src/org/exist/http/RESTServer.java =================================================================== --- trunk/eXist-1.0/src/org/exist/http/RESTServer.java 2006-06-10 20:46:52 UTC (rev 3672) +++ trunk/eXist-1.0/src/org/exist/http/RESTServer.java 2006-06-10 20:47:19 UTC (rev 3673) @@ -250,10 +250,11 @@ source = option.equals("yes"); String stylesheet; if ((stylesheet = request.getParameter("_xsl")) != null) { - if (stylesheet.equals("no")) - outputProperties.setProperty(EXistOutputKeys.PROCESS_XSL_PI, - stylesheet); - else + if (stylesheet.equals("no")) { + outputProperties.setProperty(EXistOutputKeys.PROCESS_XSL_PI, "no"); + outputProperties.remove(EXistOutputKeys.STYLESHEET); + stylesheet = null; + } else outputProperties.setProperty(EXistOutputKeys.STYLESHEET, stylesheet); } else @@ -271,7 +272,7 @@ XmldbURI pathUri = XmldbURI.create(path); try { // check if path leads to an XQuery resource - resource = (DocumentImpl) broker.getXMLResource(pathUri, Lock.READ_LOCK); + resource = broker.getXMLResource(pathUri, Lock.READ_LOCK); if (resource != null) { if (resource.getResourceType() == DocumentImpl.BINARY_FILE && "application/xquery".equals(resource.getMetadata().getMimeType())) @@ -408,7 +409,7 @@ } else { - if (serializer.isStylesheetApplied() || Serializer.hasXSLPi(resource) != null) + if (serializer.isStylesheetApplied() || serializer.hasXSLPi(resource) != null) { response.setContentType("text/html; charset="+encoding); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |