Haskell XML library
Haskell
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
Text/XML
tests
.gitignore
LICENSE
README.md
Setup.hs
xml.cabal

README.md

XML

Light-weight library for simple parsing and creation of XML documents. It only depends on base, bytestring and text.

The library primarily uses the String type, which makes it rather inefficient for large files.

Example

{-# LANGUAGE RecordWildCards #-}
import Text.XML.Light

data Package = Package
  { pOrderNo  :: String
  , pOrderPos :: String
  , pBarcode  :: String
  , pNumber   :: String
  }

-- | Create XML from a Package
instance Node Package where
  node qn Package {..} =
    node qn
      [ unode "package_number" pNumber
      , unode "package_barcode" pBarcode
      , unode "order_number" pOrderNo
      , unode "order_position" pOrderPos
      ]