Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- parseContent :: Monad m => (Text -> Either Text a) -> DomParserT Identity m a
- getCurrentName :: Monad m => DomParserT Identity m Name
- getCurrentContent :: Monad m => DomParserT Identity m (Maybe Text)
- checkCurrentName :: Monad m => NameMatcher -> DomParserT Identity m ()
- maybeReadContent :: forall a. Typeable a => (Text -> Maybe a) -> Text -> Either Text a
- readContent :: (Read a, Typeable a) => Text -> Either Text a
- readBool :: Text -> Either Text Bool
- readChar :: Text -> Either Text Char
Parsing element's content
:: Monad m | |
=> (Text -> Either Text a) | Content parser, return error msg if value is not parsed |
-> DomParserT Identity m a |
Parses content inside current tag. It expects current element set consists of exactly ONE element.
Getting current element's properties
getCurrentName :: Monad m => DomParserT Identity m Name Source #
Returns name of current element.
Since: 1.0.0
getCurrentContent :: Monad m => DomParserT Identity m (Maybe Text) Source #
Get current content. If current element contains no content or have inner elements then Nothing returned
Since: 1.0.0
checkCurrentName :: Monad m => NameMatcher -> DomParserT Identity m () Source #
If name of current tag differs from first argument throws PENotFound
with
tag name replaced in last path's segment. Useful for checking root
document's element name.
Internal
readContent :: (Read a, Typeable a) => Text -> Either Text a Source #
Tries to read given text to value using Read
. Useful to use
with parseContent
and parseAttribute
. Content is stripped
before reading.