xml-helpers-1.0.0: Some useful helper functions for the xml library.
Safe HaskellSafe
LanguageHaskell98

Text.XML.Light.Helpers

Description

A set of useful helper functions for dealing with XML data.

Synopsis

Documentation

mapChildren :: String -> Element -> (Element -> Maybe a) -> Maybe [a] Source #

Map the given function over the children of the given element with the given name.

foldChildren :: String -> Element -> a -> (a -> Element -> Maybe a) -> Maybe a Source #

Fold the function over the children of the given element with the given name.

mapElements :: String -> Element -> (Element -> Maybe a) -> Maybe [a] Source #

Map the given function over all subelements of the given element with the given name.

foldElements :: String -> Element -> a -> (a -> Element -> Maybe a) -> Maybe a Source #

Fold the given function over the children of the given element with the given name.

mapChildrenWithAttName :: String -> Element -> (Element -> Maybe a) -> Maybe [a] Source #

Map the given function over the children of the given element that have an attribute "name" matching the given string.

mapElementsWithAttName :: String -> Element -> (Element -> Maybe a) -> Maybe [a] Source #

Map the given function over the subelements of the given element that have an attribute "name" matching the given string.

foldChildrenWithAttName :: String -> Element -> a -> (a -> Element -> Maybe a) -> Maybe a Source #

Fold the given function over the children of the given element that have an attribute "name" matching the given string.

foldElementsWithAttName :: String -> Element -> a -> (a -> Element -> Maybe a) -> Maybe a Source #

Fold the given function over the subelements of the given element that have an attribute "name" matching the given string.

getChildData :: String -> Element -> Maybe String Source #

Get the string contents of the child of the given element with the given name.

getElementData :: String -> Element -> Maybe String Source #

Get the string contents of the subelement of the given element with the given name.

findChildWithAttName :: String -> Element -> Maybe Element Source #

Find a child of the given element with that has an attribute "name" equal to the given string.

findChildrenWithAttName :: String -> Element -> [Element] Source #

Find all the children of the given element that have an attribute "name" equal to the given string.

findElementWithAttName :: String -> Element -> Maybe Element Source #

Find a subelement of the given element that has an attribute "name" equal to the given string.

findElementsWithAttName :: String -> Element -> [Element] Source #

Find all the subelements of the given element that have an attribute "name" equal to the given string.

elementHasNameAttr :: String -> Element -> Bool Source #

Returns True iff the given alement has an attribute "name" equal to the given string.

parseRows :: (Element -> Maybe a) -> Element -> Maybe [a] Source #

Convert a list of rows (subelement with the name "row") into a Haskell datatype using the given function.s