xml-extractors-0.4.0.1: Extension to the xml package to extract data from parsed xml

Safe HaskellSafe-Inferred
LanguageHaskell2010

Text.XML.Light.Extractors.Internal

Contents

Synopsis

Documentation

type Path = [String] Source

Location for some content.

For now it is a reversed list of content indices (starting at 1) and element names. This may change to something less "stringly typed".

data Err Source

Extraction errors.

Constructors

ErrExpectContent

Some expected content is missing

ErrExpectAttrib

An expected attribute is missing

Fields

expectedAttrib :: String

name of expected attribute

atElement :: Element

element with missing attribute

ErrAttribValue

An attribute value was bad

Fields

expectedValue :: String

description of expected value

foundValue :: String

the value found

atElement :: Element

element with missing attribute

ErrEnd

Expected end of contents

ErrNull

Unexpected end of contents

ErrMsg String 

Instances

data ExtractionErr Source

Error with a context.

Constructors

ExtractionErr 

Fields

err :: Err
 
context :: Path
 

Element extraction

attribAs Source

Arguments

:: String

name of attribute to extract

-> (String -> Either String a)

function returning given string to some value or an error message

-> ElementExtractor a 

Contents extraction