-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Some useful helper functions for the xml library.
--   
--   Included are some folds and maps I've found useful in parsing XML
--   data.
@package xml-helpers
@version 1.0.0


-- | A set of useful helper functions for dealing with XML data.
module Text.XML.Light.Helpers

-- | Map the given function over the children of the given element with the
--   given name.
mapChildren :: String -> Element -> (Element -> Maybe a) -> Maybe [a]

-- | Fold the function over the children of the given element with the
--   given name.
foldChildren :: String -> Element -> a -> (a -> Element -> Maybe a) -> Maybe a

-- | Map the given function over all subelements of the given element with
--   the given name.
mapElements :: String -> Element -> (Element -> Maybe a) -> Maybe [a]

-- | Fold the given function over the children of the given element with
--   the given name.
foldElements :: String -> Element -> a -> (a -> Element -> Maybe a) -> Maybe a

-- | Map the given function over the children of the given element that
--   have an attribute "name" matching the given string.
mapChildrenWithAttName :: String -> Element -> (Element -> Maybe a) -> Maybe [a]

-- | Map the given function over the subelements of the given element that
--   have an attribute "name" matching the given string.
mapElementsWithAttName :: String -> Element -> (Element -> Maybe a) -> Maybe [a]

-- | Fold the given function over the children of the given element that
--   have an attribute "name" matching the given string.
foldChildrenWithAttName :: String -> Element -> a -> (a -> Element -> Maybe a) -> Maybe a

-- | Fold the given function over the subelements of the given element that
--   have an attribute "name" matching the given string.
foldElementsWithAttName :: String -> Element -> a -> (a -> Element -> Maybe a) -> Maybe a

-- | Get the string contents of the child of the given element with the
--   given name.
getChildData :: String -> Element -> Maybe String

-- | Get the string contents of the subelement of the given element with
--   the given name.
getElementData :: String -> Element -> Maybe String

-- | Find a child of the given element with that has an attribute "name"
--   equal to the given string.
findChildWithAttName :: String -> Element -> Maybe Element

-- | Find all the children of the given element that have an attribute
--   "name" equal to the given string.
findChildrenWithAttName :: String -> Element -> [Element]

-- | Find a subelement of the given element that has an attribute "name"
--   equal to the given string.
findElementWithAttName :: String -> Element -> Maybe Element

-- | Find all the subelements of the given element that have an attribute
--   "name" equal to the given string.
findElementsWithAttName :: String -> Element -> [Element]

-- | Returns True iff the given alement has an attribute "name" equal to
--   the given string.
elementHasNameAttr :: String -> Element -> Bool

-- | Convert a list of rows (subelement with the name "row") into a Haskell
--   datatype using the given function.s
parseRows :: (Element -> Maybe a) -> Element -> Maybe [a]
