]> gitweb @ CieloNegro.org - Rakka.git/blobdiff - Rakka/Resource.hs
wrote much code...
[Rakka.git] / Rakka / Resource.hs
index c79b215cfe5fb5e1bce74101982c18ee3cc7922c..e1166b4d33079b0096d81a63f2d8c00af1d8b396 100644 (file)
@@ -70,10 +70,9 @@ outputXmlPage :: XmlTree -> IOSArrow XmlTree XmlTree -> Resource ()
 outputXmlPage tree toXHTML
     = do mType <- getEntityType
          setContentType mType
-         let formatter = if mType == read "text/xml" then
-                             this
-                         else
-                             toXHTML
+         let formatter = case mType of
+                           MIMEType "application" "xhtml+xml" _ -> toXHTML
+                           MIMEType "text"        "xml"       _ -> this
          [resultStr] <- liftIO $ runX ( setErrorMsgHandler False fail
                                         >>>
                                         constA tree