Copyright | (c) 2013-2016 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay <brendan.g.hay@gmail.com> |
Stability | provisional |
Portability | non-portable (GHC extensions) |
Safe Haskell | None |
Language | Haskell2010 |
- (.@) :: FromXML a => [Node] -> Text -> Either String a
- (.@?) :: FromXML a => [Node] -> Text -> Either String (Maybe a)
- (@=) :: ToXML a => Name -> a -> XML
- decodeXML :: FromXML a => LazyByteString -> Either String a
- encodeXML :: ToElement a => a -> LazyByteString
- class FromXML a where
- class ToElement a where
- maybeElement :: ToElement a => a -> Maybe Element
- data XML
- listXMLNodes :: XML -> [Node]
- class ToXML a where
- toXMLNodes :: ToXML a => a -> [Node]
- parseXMLList :: FromXML a => Text -> [Node] -> Either String [a]
- parseXMLText :: FromText a => String -> [Node] -> Either String a
- toXMLList :: (IsList a, ToXML (Item a)) => Name -> a -> XML
- toXMLText :: ToText a => a -> XML
- mkElement :: ToXML a => Name -> a -> Element
- withContent :: String -> [Node] -> Either String (Maybe Text)
- withElement :: Text -> ([Node] -> Either String a) -> [Node] -> Either String a
- findElement :: Text -> [Node] -> Either String [Node]
- firstElement :: Text -> [Node] -> Either String [Node]
- childNodesOf :: Text -> Node -> Maybe [Node]
- localName :: Node -> Maybe Text
- rootElementName :: LazyByteString -> Maybe Text
- missingElement :: Text -> [Node] -> Maybe a -> Either String a
Documentation
encodeXML :: ToElement a => a -> LazyByteString Source #
class FromXML a where Source #
maybeElement :: ToElement a => a -> Maybe Element Source #
Convert to an Element
, only if the resulting element contains > 0
nodes.
Provides a way to make the operators for ToXML instance declaration be consistent WRT to single nodes or lists of nodes.
listXMLNodes :: XML -> [Node] Source #
ToXML Bool Source # | |
ToXML Double Source # | |
ToXML Int Source # | |
ToXML Integer Source # | |
ToXML ByteString Source # | |
ToXML Text Source # | |
ToXML Natural Source # | |
ToXML XML Source # | |
ToXML Nat Source # | |
ToXML Region Source # | |
ToXML Base64 Source # | |
ToXML AWSTime Source # | |
ToXML BasicTime Source # | |
ToXML ISO8601 Source # | |
ToXML RFC822 Source # | |
ToXML a => ToXML (Maybe a) Source # | |
ToXML a => ToXML (Sensitive a) Source # | |
toXMLNodes :: ToXML a => a -> [Node] Source #
findElement :: Text -> [Node] -> Either String [Node] Source #
Find a specific named NodeElement, at the current depth in the node tree.
Fails if absent.
firstElement :: Text -> [Node] -> Either String [Node] Source #
Find the first specific named NodeElement, at any depth in the node tree.
Fails if absent.
rootElementName :: LazyByteString -> Maybe Text Source #
An inefficient mechanism for retreiving the root element name of an XML document.