 Config      -- ^ Pointer to the /config.yaml/ file.
             -> Cursor      -- ^ XML document 'Cursor' pointing at @confluenceTable@ /class/ attribute.
             -> Maybe Table -- ^ The processed 'Maybe' 'Table'.
processTable cnf c = case cells of
    _ : headersRaw : xs ->
        let headers       = tail (mapMaybe getHeader headersRaw)
            (_, mcourses) = L.mapAccumL (getRow cnf headers) [] xs
        in Just $ Table (unsafePerformIO getCurrentTime) headers (catMaybes mcourses)
    _               -> Nothing
  where
    cells = map ($/ anyElement) (c $// element "tr")


{- | Create a value of type 'Maybe' 'Header' corresponding to the value of the raw
    XML-cell containing information about the 'Header'.
-}
getHeader :: C
processTable :: Config      -- ^ Pointer to the /config.yaml/ file.
             -> Cursor      -- ^ XML document 'Cursor' pointing at @confluenceTable@ /class/ attribute.
             -> Maybe Table
processTable cnf c = case cells of
    _ : headersRaw : xs ->
        let headers       = tail (mapMaybe getHeader headersRaw)
            (_, mcourses) = L.mapAccumL (getRow cnf headers) [] xs
        in Just $ Table (unsafePerformIO getCurrentTime) headers (catMaybes mcourses)
    _               -> Nothing
  where
    cells = map ($/ anyElement) (c $// element "tr")


{- | Create a value of type 'Maybe' 'Header' corresponding to the value of the raw
    XML-cell containing information about the 'Header'.
-}
processTable cnf c = case cells of
    _ : headersRaw : xs ->
        let headers       = tail (mapMaybe getHeader headersRaw)
            (_, mcourses) = L.mapAccumL (getRow cnf headers) [] xs
        in Just $ Table (unsafePerformIO getCurrentTime) headers (catMaybes mcourses)
    _               -> Nothing
  where
    cells = map ($/ anyElement) (c $// element "tr")


{- | Create a value of type 'Maybe' 'Header' corresponding to the value of the raw
    XML-cell containing information about the 'Header'.
-}