Can not fetch and process xml resources

    let url = "http://localhost:1234/" <> formatYearMonth dt <> "/" <> formatDate dt <> ".xml"
    res <- get document url
    case res of
      Left err -> do
        liftEffect $ log $ "TCMB exchange request error:" <> printError err
        pure Nothing
      Right response@{body} -> do

get function is from Affjax module.

This code writes TCMB exchange request error:There was a problem with the response body: Type mismatch: expected Document, found XMLDocument to the console.

How can I receive and process xml resources?

Thanks in advance.

probably new ResponseFormat.ResponseFormat a should be added

Iā€™m not sure, but error probably happens here

1 Like


I parsed the response by retreiving as string and parsing by purescript-web-dom-parser. This works but adds an extra step of parsing.

ResponseFormat for XMLDocument would be handy.

1 Like