File: Export.hs

package info (click to toggle)
haskell-feed 0.3.7-4
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 416 kB
  • sloc: haskell: 3,423; xml: 1,096; makefile: 2
file content (35 lines) | stat: -rw-r--r-- 891 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
--------------------------------------------------------------------
-- |
-- Module    : Text.Feed.Export
-- Copyright : (c) Galois, Inc. 2008
-- License   : BSD3
--
-- Maintainer: Sigbjorn Finne <sof@galois.com>
-- Stability : provisional
-- Description: Convert from Feeds to XML.
--
--------------------------------------------------------------------


module Text.Feed.Export 
       ( Text.Feed.Export.xmlFeed  -- :: Feed -> XML.Element
       ) where

import Text.Feed.Types

import Text.Atom.Feed.Export as Atom
import Text.RSS.Export as RSS
import Text.RSS1.Export as RSS1

import Text.XML.Light as XML

-- | 'xmlFeed f' serializes a @Feed@ document into a conforming
-- XML toplevel element.
xmlFeed :: Feed -> XML.Element
xmlFeed fe =
  case fe of
   AtomFeed f -> Atom.xmlFeed f
   RSSFeed  f -> RSS.xmlRSS f
   RSS1Feed f -> RSS1.xmlFeed f
   XMLFeed e  -> e -- that was easy!