Safe Haskell | None |
---|
- parseXML :: (MonadThrow m, FromJSON a) => ByteString -> m a
- xmlToJSON :: MonadThrow m => ByteString -> m Value
- data JSONParseError
- bsSourceToJSON :: MonadThrow m => Source m ByteString -> m Value
- bsRSourceToJSON :: MonadThrow m => ResumableSource m ByteString -> m Value
- tokenToBuilder :: Token -> Builder
- elementToJSON :: Element -> Value
- tokensToJSON :: [Token] -> Value
Documentation
This library provide a way to convert xml to json.
Further more, by combining with aeson's parsing facility, it provide a way to parse xml to haskell data type.
parseXML :: (MonadThrow m, FromJSON a) => ByteString -> m aSource
parse xml to haskell data type by using aeson's FromJSON
.
xmlToJSON :: MonadThrow m => ByteString -> m ValueSource
convert lazy xml ByteString
to aeson Value
.
streamlined api
bsSourceToJSON :: MonadThrow m => Source m ByteString -> m ValueSource
Consume a source and convert the content to aeson Value
, it try to inspect xml encoding from first tag.
e.g. bsSourceToJSON (C.sourceFile path_to_xml_file)
bsRSourceToJSON :: MonadThrow m => ResumableSource m ByteString -> m ValueSource
Consume a source and convert the content to aeson Value
, it try to inspect xml encoding from first tag.
e.g. xmlStreamToJSONResumable (requestBody req)
utils
tokenToBuilder :: Token -> BuilderSource
Convert tagstream-conduit Token
to xml element Builder
elementToJSON :: Element -> ValueSource
tokensToJSON :: [Token] -> ValueSource
Convert list of tagstream-conduit Token
to aeson Value