xml-types-0.3.8: Basic types for representing XML

Copyright | 2010-2011 John Millikin
License | MIT
Safe Haskell | Safe-Inferred
Language | Haskell2010

Data.XML.Types

Contents

- Types
  - Document prologue
  - Document body
  - Doctypes
  - Incremental processing
- Combinators
  - Filters
  - Element traversal
  - Node traversal
  - Attributes

Description

Basic types for representing XML.

The idea is to have a full set of appropriate types, which various XML libraries can share. Instead of having equivalent-but-incompatible types for every binding, parser, or client, they all share the same types can can thus interoperate easily.

This library contains complete types for most parts of an XML document, including the prologue, node tree, and doctype. Some basic combinators are included for common tasks, including traversing the node tree and filtering children.

Synopsis

- data Document = Document {
  - documentPrologue :: Prologue
  - documentRoot :: Element
  - documentEpilogue :: [Miscellaneous]
  }
- data Prologue = Prologue {
  - prologueBefore :: [Miscellaneous]
  - prologueDoctype :: Maybe Doctype
  - prologueAfter :: [Miscellaneous]
  }
- data Instruction = Instruction {
  - instructionTarget :: Text
  - instructionData :: Text
  }
- data Miscellaneous
  - = MiscInstruction Instruction
  - | MiscComment Text
- data Node
  - = NodeElement Element
  - | NodeInstruction Instruction
  - | NodeContent Content
  - | NodeComment Text
- data Element = Element {
  - elementName :: Name
  - elementAttributes :: [(Name, [Content])]
  - elementNodes :: [Node]
  }
- data Content
  - = ContentText Text
  - | ContentEntity Text
- data Name = Name {
  - nameLocalName :: Text
  - nameNamespace :: Maybe Text
  - namePrefix :: Maybe Text
  }
- data Doctype = Doctype {
  - doctypeName :: Text
  - doctypeID :: Maybe ExternalID
  }
- data ExternalID
  - = SystemID Text
  - | PublicID Text Text
- data Event
  - = EventBeginDocument
  - | EventEndDocument
  - | EventBeginDoctype Text (Maybe ExternalID)
  - | EventEndDoctype
  - | EventInstruction Instruction
  - | EventBeginElement Name [(Name, [Content])]
  - | EventEndElement Name
  - | EventContent Content
  - | EventComment Text
  - | EventCDATA Text
- isElement :: Node -> [Element]
- isInstruction :: Node -> [Instruction]
- isContent :: Node -> [Content]
- isComment :: Node -> [Text]
- isNamed :: Name -> Element -> [Element]
- elementChildren :: Element -> [Element]
- elementContent :: Element -> [Content]
- elementText :: Element -> [Text]
- nodeChildren :: Node -> [Node]
- nodeContent :: Node -> [Content]
- nodeText :: Node -> [Text]
- hasAttribute :: Name -> Element -> [Element]
- hasAttributeText :: Name -> (Text -> Bool) -> Element -> [Element]
- attributeContent :: Name -> Element -> Maybe [Content]
- attributeText :: Name -> Element -> Maybe Text

# Types

## Document prologue

data Document Source #

Constructors

Document |

Fields

- documentPrologue :: Prologue
- documentRoot :: Element
- documentEpilogue :: [Miscellaneous]

#### Instances

Instances details

NFData Document Source # |
Instance details Defined in Data.XML.Types Methods rnf :: Document -> () Source #
Data Document Source # |

Instance details

Defined in Data.XML.Types

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Document -> c Document Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Document Source #

toConstr :: Document -> Constr Source #

dataTypeOf :: Document -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Document) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Document) Source #

gmapT :: (forall b. Data b => b -> b) -> Document -> Document Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Document -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Document -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> Document -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Document -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Document -> m Document Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Document -> m Document Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Document -> m Document Source #

Generic Document Source # |

Instance details

Defined in Data.XML.Types

Associated Types

type Rep Document |

Instance details

Defined in Data.XML.Types

type Rep Document = D1 ('MetaData "Document" "Data.XML.Types" "xml-types-0.3.8-CPraXujWO7hCdGwznbCwrz" 'False) (C1 ('MetaCons "Document" 'PrefixI 'True) (S1 ('MetaSel ('Just "documentPrologue") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Prologue) :*: (S1 ('MetaSel ('Just "documentRoot") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Element) :*: S1 ('MetaSel ('Just "documentEpilogue") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Miscellaneous]))))

Methods

from :: Document -> Rep Document x Source #

to :: Rep Document x -> Document Source #

Show Document Source # |
Instance details Defined in Data.XML.Types Methods showsPrec :: Int -> Document -> ShowS Source # show :: Document -> String Source # showList :: [Document] -> ShowS Source #
Eq Document Source # |
Instance details Defined in Data.XML.Types Methods (==) :: Document -> Document -> Bool Source # (/=) :: Document -> Document -> Bool Source #
Ord Document Source # |
Instance details Defined in Data.XML.Types Methods compare :: Document -> Document -> Ordering Source # (<) :: Document -> Document -> Bool Source # (<=) :: Document -> Document -> Bool Source # (>) :: Document -> Document -> Bool Source # (>=) :: Document -> Document -> Bool Source # max :: Document -> Document -> Document Source # min :: Document -> Document -> Document Source #
type Rep Document Source # |

Instance details

Defined in Data.XML.Types

type Rep Document = D1 ('MetaData "Document" "Data.XML.Types" "xml-types-0.3.8-CPraXujWO7hCdGwznbCwrz" 'False) (C1 ('MetaCons "Document" 'PrefixI 'True) (S1 ('MetaSel ('Just "documentPrologue") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Prologue) :*: (S1 ('MetaSel ('Just "documentRoot") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Element) :*: S1 ('MetaSel ('Just "documentEpilogue") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Miscellaneous]))))

data Prologue Source #

Constructors

Prologue |

Fields

- prologueBefore :: [Miscellaneous]
- prologueDoctype :: Maybe Doctype
- prologueAfter :: [Miscellaneous]

#### Instances

Instances details

NFData Prologue Source # |
Instance details Defined in Data.XML.Types Methods rnf :: Prologue -> () Source #
Data Prologue Source # |

Instance details

Defined in Data.XML.Types

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Prologue -> c Prologue Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Prologue Source #

toConstr :: Prologue -> Constr Source #

dataTypeOf :: Prologue -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Prologue) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Prologue) Source #

gmapT :: (forall b. Data b => b -> b) -> Prologue -> Prologue Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Prologue -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Prologue -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> Prologue -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Prologue -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Prologue -> m Prologue Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Prologue -> m Prologue Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Prologue -> m Prologue Source #

Generic Prologue Source # |

Instance details

Defined in Data.XML.Types

Associated Types

type Rep Prologue |

Instance details

Defined in Data.XML.Types

type Rep Prologue = D1 ('MetaData "Prologue" "Data.XML.Types" "xml-types-0.3.8-CPraXujWO7hCdGwznbCwrz" 'False) (C1 ('MetaCons "Prologue" 'PrefixI 'True) (S1 ('MetaSel ('Just "prologueBefore") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Miscellaneous]) :*: (S1 ('MetaSel ('Just "prologueDoctype") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Doctype)) :*: S1 ('MetaSel ('Just "prologueAfter") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Miscellaneous]))))

Methods

from :: Prologue -> Rep Prologue x Source #

to :: Rep Prologue x -> Prologue Source #

Show Prologue Source # |
Instance details Defined in Data.XML.Types Methods showsPrec :: Int -> Prologue -> ShowS Source # show :: Prologue -> String Source # showList :: [Prologue] -> ShowS Source #
Eq Prologue Source # |
Instance details Defined in Data.XML.Types Methods (==) :: Prologue -> Prologue -> Bool Source # (/=) :: Prologue -> Prologue -> Bool Source #
Ord Prologue Source # |
Instance details Defined in Data.XML.Types Methods compare :: Prologue -> Prologue -> Ordering Source # (<) :: Prologue -> Prologue -> Bool Source # (<=) :: Prologue -> Prologue -> Bool Source # (>) :: Prologue -> Prologue -> Bool Source # (>=) :: Prologue -> Prologue -> Bool Source # max :: Prologue -> Prologue -> Prologue Source # min :: Prologue -> Prologue -> Prologue Source #
type Rep Prologue Source # |

Instance details

Defined in Data.XML.Types

type Rep Prologue = D1 ('MetaData "Prologue" "Data.XML.Types" "xml-types-0.3.8-CPraXujWO7hCdGwznbCwrz" 'False) (C1 ('MetaCons "Prologue" 'PrefixI 'True) (S1 ('MetaSel ('Just "prologueBefore") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Miscellaneous]) :*: (S1 ('MetaSel ('Just "prologueDoctype") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Doctype)) :*: S1 ('MetaSel ('Just "prologueAfter") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Miscellaneous]))))

data Instruction Source #

Constructors

Instruction |

Fields

- instructionTarget :: Text
- instructionData :: Text

#### Instances

Instances details

NFData Instruction Source # |
Instance details Defined in Data.XML.Types Methods rnf :: Instruction -> () Source #
Data Instruction Source # |

Instance details

Defined in Data.XML.Types

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Instruction -> c Instruction Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Instruction Source #

toConstr :: Instruction -> Constr Source #

dataTypeOf :: Instruction -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Instruction) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Instruction) Source #

gmapT :: (forall b. Data b => b -> b) -> Instruction -> Instruction Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Instruction -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Instruction -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> Instruction -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Instruction -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Instruction -> m Instruction Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Instruction -> m Instruction Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Instruction -> m Instruction Source #

Generic Instruction Source # |

Instance details

Defined in Data.XML.Types

Associated Types

type Rep Instruction |

Instance details

Defined in Data.XML.Types

type Rep Instruction = D1 ('MetaData "Instruction" "Data.XML.Types" "xml-types-0.3.8-CPraXujWO7hCdGwznbCwrz" 'False) (C1 ('MetaCons "Instruction" 'PrefixI 'True) (S1 ('MetaSel ('Just "instructionTarget") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "instructionData") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))

Methods

from :: Instruction -> Rep Instruction x Source #

to :: Rep Instruction x -> Instruction Source #

Show Instruction Source # |
Instance details Defined in Data.XML.Types Methods showsPrec :: Int -> Instruction -> ShowS Source # show :: Instruction -> String Source # showList :: [Instruction] -> ShowS Source #
Eq Instruction Source # |
Instance details Defined in Data.XML.Types Methods (==) :: Instruction -> Instruction -> Bool Source # (/=) :: Instruction -> Instruction -> Bool Source #
Ord Instruction Source # |

Instance details

Defined in Data.XML.Types

Methods

compare :: Instruction -> Instruction -> Ordering Source #

(<) :: Instruction -> Instruction -> Bool Source #

(<=) :: Instruction -> Instruction -> Bool Source #

(>) :: Instruction -> Instruction -> Bool Source #

(>=) :: Instruction -> Instruction -> Bool Source #

max :: Instruction -> Instruction -> Instruction Source #

min :: Instruction -> Instruction -> Instruction Source #

type Rep Instruction Source # |

Instance details

Defined in Data.XML.Types

type Rep Instruction = D1 ('MetaData "Instruction" "Data.XML.Types" "xml-types-0.3.8-CPraXujWO7hCdGwznbCwrz" 'False) (C1 ('MetaCons "Instruction" 'PrefixI 'True) (S1 ('MetaSel ('Just "instructionTarget") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "instructionData") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))

data Miscellaneous Source #

Constructors

MiscInstruction Instruction |
MiscComment Text |

#### Instances

Instances details

NFData Miscellaneous Source # |
Instance details Defined in Data.XML.Types Methods rnf :: Miscellaneous -> () Source #
Data Miscellaneous Source # |

Instance details

Defined in Data.XML.Types

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Miscellaneous -> c Miscellaneous Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Miscellaneous Source #

toConstr :: Miscellaneous -> Constr Source #

dataTypeOf :: Miscellaneous -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Miscellaneous) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Miscellaneous) Source #

gmapT :: (forall b. Data b => b -> b) -> Miscellaneous -> Miscellaneous Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Miscellaneous -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Miscellaneous -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> Miscellaneous -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Miscellaneous -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Miscellaneous -> m Miscellaneous Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Miscellaneous -> m Miscellaneous Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Miscellaneous -> m Miscellaneous Source #

Generic Miscellaneous Source # |

Instance details

Defined in Data.XML.Types

Associated Types

type Rep Miscellaneous |

Instance details

Defined in Data.XML.Types

type Rep Miscellaneous = D1 ('MetaData "Miscellaneous" "Data.XML.Types" "xml-types-0.3.8-CPraXujWO7hCdGwznbCwrz" 'False) (C1 ('MetaCons "MiscInstruction" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Instruction)) :+: C1 ('MetaCons "MiscComment" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))

Methods

from :: Miscellaneous -> Rep Miscellaneous x Source #

to :: Rep Miscellaneous x -> Miscellaneous Source #

Show Miscellaneous Source # |
Instance details Defined in Data.XML.Types Methods showsPrec :: Int -> Miscellaneous -> ShowS Source # show :: Miscellaneous -> String Source # showList :: [Miscellaneous] -> ShowS Source #
Eq Miscellaneous Source # |
Instance details Defined in Data.XML.Types Methods (==) :: Miscellaneous -> Miscellaneous -> Bool Source # (/=) :: Miscellaneous -> Miscellaneous -> Bool Source #
Ord Miscellaneous Source # |

Instance details

Defined in Data.XML.Types

Methods

compare :: Miscellaneous -> Miscellaneous -> Ordering Source #

(<) :: Miscellaneous -> Miscellaneous -> Bool Source #

(<=) :: Miscellaneous -> Miscellaneous -> Bool Source #

(>) :: Miscellaneous -> Miscellaneous -> Bool Source #

(>=) :: Miscellaneous -> Miscellaneous -> Bool Source #

max :: Miscellaneous -> Miscellaneous -> Miscellaneous Source #

min :: Miscellaneous -> Miscellaneous -> Miscellaneous Source #

type Rep Miscellaneous Source # |

Instance details

Defined in Data.XML.Types

type Rep Miscellaneous = D1 ('MetaData "Miscellaneous" "Data.XML.Types" "xml-types-0.3.8-CPraXujWO7hCdGwznbCwrz" 'False) (C1 ('MetaCons "MiscInstruction" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Instruction)) :+: C1 ('MetaCons "MiscComment" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))

## Document body

data Node Source #

Constructors

NodeElement Element |
NodeInstruction Instruction |
NodeContent Content |
NodeComment Text |

#### Instances

Instances details

NFData Node Source # |
Instance details Defined in Data.XML.Types Methods rnf :: Node -> () Source #
Data Node Source # |

Instance details

Defined in Data.XML.Types

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Node -> c Node Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Node Source #

toConstr :: Node -> Constr Source #

dataTypeOf :: Node -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Node) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Node) Source #

gmapT :: (forall b. Data b => b -> b) -> Node -> Node Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Node -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Node -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> Node -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Node -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Node -> m Node Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Node -> m Node Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Node -> m Node Source #

IsString Node Source # |
Instance details Defined in Data.XML.Types Methods fromString :: String -> Node Source #
Generic Node Source # |

Instance details

Defined in Data.XML.Types

Associated Types

type Rep Node |

Instance details

Defined in Data.XML.Types

type Rep Node = D1 ('MetaData "Node" "Data.XML.Types" "xml-types-0.3.8-CPraXujWO7hCdGwznbCwrz" 'False) ((C1 ('MetaCons "NodeElement" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Element)) :+: C1 ('MetaCons "NodeInstruction" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Instruction))) :+: (C1 ('MetaCons "NodeContent" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Content)) :+: C1 ('MetaCons "NodeComment" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text))))

Methods

from :: Node -> Rep Node x Source #

to :: Rep Node x -> Node Source #

Show Node Source # |
Instance details Defined in Data.XML.Types Methods showsPrec :: Int -> Node -> ShowS Source # show :: Node -> String Source # showList :: [Node] -> ShowS Source #
Eq Node Source # |
Instance details Defined in Data.XML.Types Methods (==) :: Node -> Node -> Bool Source # (/=) :: Node -> Node -> Bool Source #
Ord Node Source # |
Instance details Defined in Data.XML.Types Methods compare :: Node -> Node -> Ordering Source # (<) :: Node -> Node -> Bool Source # (<=) :: Node -> Node -> Bool Source # (>) :: Node -> Node -> Bool Source # (>=) :: Node -> Node -> Bool Source # max :: Node -> Node -> Node Source # min :: Node -> Node -> Node Source #
type Rep Node Source # |

Instance details

Defined in Data.XML.Types

type Rep Node = D1 ('MetaData "Node" "Data.XML.Types" "xml-types-0.3.8-CPraXujWO7hCdGwznbCwrz" 'False) ((C1 ('MetaCons "NodeElement" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Element)) :+: C1 ('MetaCons "NodeInstruction" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Instruction))) :+: (C1 ('MetaCons "NodeContent" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Content)) :+: C1 ('MetaCons "NodeComment" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text))))

data Element Source #

Constructors

Element |

Fields

- elementName :: Name
- elementAttributes :: [(Name, [Content])]
- elementNodes :: [Node]

#### Instances

Instances details

NFData Element Source # |
Instance details Defined in Data.XML.Types Methods rnf :: Element -> () Source #
Data Element Source # |

Instance details

Defined in Data.XML.Types

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Element -> c Element Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Element Source #

toConstr :: Element -> Constr Source #

dataTypeOf :: Element -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Element) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Element) Source #

gmapT :: (forall b. Data b => b -> b) -> Element -> Element Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Element -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Element -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> Element -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Element -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Element -> m Element Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Element -> m Element Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Element -> m Element Source #

Generic Element Source # |

Instance details

Defined in Data.XML.Types

Associated Types

type Rep Element |

Instance details

Defined in Data.XML.Types

type Rep Element = D1 ('MetaData "Element" "Data.XML.Types" "xml-types-0.3.8-CPraXujWO7hCdGwznbCwrz" 'False) (C1 ('MetaCons "Element" 'PrefixI 'True) (S1 ('MetaSel ('Just "elementName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Name) :*: (S1 ('MetaSel ('Just "elementAttributes") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [(Name, [Content])]) :*: S1 ('MetaSel ('Just "elementNodes") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Node]))))

Methods

from :: Element -> Rep Element x Source #

to :: Rep Element x -> Element Source #

Show Element Source # |
Instance details Defined in Data.XML.Types Methods showsPrec :: Int -> Element -> ShowS Source # show :: Element -> String Source # showList :: [Element] -> ShowS Source #
Eq Element Source # |
Instance details Defined in Data.XML.Types Methods (==) :: Element -> Element -> Bool Source # (/=) :: Element -> Element -> Bool Source #
Ord Element Source # |
Instance details Defined in Data.XML.Types Methods compare :: Element -> Element -> Ordering Source # (<) :: Element -> Element -> Bool Source # (<=) :: Element -> Element -> Bool Source # (>) :: Element -> Element -> Bool Source # (>=) :: Element -> Element -> Bool Source # max :: Element -> Element -> Element Source # min :: Element -> Element -> Element Source #
type Rep Element Source # |

Instance details

Defined in Data.XML.Types

type Rep Element = D1 ('MetaData "Element" "Data.XML.Types" "xml-types-0.3.8-CPraXujWO7hCdGwznbCwrz" 'False) (C1 ('MetaCons "Element" 'PrefixI 'True) (S1 ('MetaSel ('Just "elementName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Name) :*: (S1 ('MetaSel ('Just "elementAttributes") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [(Name, [Content])]) :*: S1 ('MetaSel ('Just "elementNodes") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [Node]))))

data Content Source #

Constructors

ContentText Text |
ContentEntity Text | For pass-through parsing

#### Instances

Instances details

NFData Content Source # |
Instance details Defined in Data.XML.Types Methods rnf :: Content -> () Source #
Data Content Source # |

Instance details

Defined in Data.XML.Types

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Content -> c Content Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Content Source #

toConstr :: Content -> Constr Source #

dataTypeOf :: Content -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Content) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Content) Source #

gmapT :: (forall b. Data b => b -> b) -> Content -> Content Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Content -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Content -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> Content -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Content -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Content -> m Content Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Content -> m Content Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Content -> m Content Source #

IsString Content Source # |
Instance details Defined in Data.XML.Types Methods fromString :: String -> Content Source #
Generic Content Source # |

Instance details

Defined in Data.XML.Types

Associated Types

type Rep Content |

Instance details

Defined in Data.XML.Types

type Rep Content = D1 ('MetaData "Content" "Data.XML.Types" "xml-types-0.3.8-CPraXujWO7hCdGwznbCwrz" 'False) (C1 ('MetaCons "ContentText" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)) :+: C1 ('MetaCons "ContentEntity" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))

Methods

from :: Content -> Rep Content x Source #

to :: Rep Content x -> Content Source #

Show Content Source # |
Instance details Defined in Data.XML.Types Methods showsPrec :: Int -> Content -> ShowS Source # show :: Content -> String Source # showList :: [Content] -> ShowS Source #
Eq Content Source # |
Instance details Defined in Data.XML.Types Methods (==) :: Content -> Content -> Bool Source # (/=) :: Content -> Content -> Bool Source #
Ord Content Source # |
Instance details Defined in Data.XML.Types Methods compare :: Content -> Content -> Ordering Source # (<) :: Content -> Content -> Bool Source # (<=) :: Content -> Content -> Bool Source # (>) :: Content -> Content -> Bool Source # (>=) :: Content -> Content -> Bool Source # max :: Content -> Content -> Content Source # min :: Content -> Content -> Content Source #
type Rep Content Source # |

Instance details

Defined in Data.XML.Types

type Rep Content = D1 ('MetaData "Content" "Data.XML.Types" "xml-types-0.3.8-CPraXujWO7hCdGwznbCwrz" 'False) (C1 ('MetaCons "ContentText" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)) :+: C1 ('MetaCons "ContentEntity" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))

data Name Source #

A fully qualified name.

Prefixes are not semantically important; they are included only to simplify pass-through parsing. When comparing names with `Eq` or `Ord` methods, prefixes are ignored.

The `IsString` instance supports Clark notation; see http://www.jclark.com/xml/xmlns.htm and http://infohost.nmt.edu/tcc/help/pubs/pylxml/etree-QName.html. Use the `OverloadedStrings` language extension for very simple `Name` construction:

    myname :: Name
    myname = "{http://example.com/ns/my-namespace}my-name"

Constructors

Name |

Fields

- nameLocalName :: Text
- nameNamespace :: Maybe Text
- namePrefix :: Maybe Text

#### Instances

Instances details

NFData Name Source # |
Instance details Defined in Data.XML.Types Methods rnf :: Name -> () Source #
Data Name Source # |

Instance details

Defined in Data.XML.Types

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Name -> c Name Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Name Source #

toConstr :: Name -> Constr Source #

dataTypeOf :: Name -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Name) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Name) Source #

gmapT :: (forall b. Data b => b -> b) -> Name -> Name Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Name -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Name -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> Name -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Name -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Name -> m Name Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Name -> m Name Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Name -> m Name Source #

IsString Name Source # |
Instance details Defined in Data.XML.Types Methods fromString :: String -> Name Source #
Generic Name Source # |

Instance details

Defined in Data.XML.Types

Associated Types

type Rep Name |

Instance details

Defined in Data.XML.Types

type Rep Name = D1 ('MetaData "Name" "Data.XML.Types" "xml-types-0.3.8-CPraXujWO7hCdGwznbCwrz" 'False) (C1 ('MetaCons "Name" 'PrefixI 'True) (S1 ('MetaSel ('Just "nameLocalName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: (S1 ('MetaSel ('Just "nameNamespace") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "namePrefix") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text)))))

Methods

from :: Name -> Rep Name x Source #

to :: Rep Name x -> Name Source #

Show Name Source # |
Instance details Defined in Data.XML.Types Methods showsPrec :: Int -> Name -> ShowS Source # show :: Name -> String Source # showList :: [Name] -> ShowS Source #
Eq Name Source # |
Instance details Defined in Data.XML.Types Methods (==) :: Name -> Name -> Bool Source # (/=) :: Name -> Name -> Bool Source #
Ord Name Source # |
Instance details Defined in Data.XML.Types Methods compare :: Name -> Name -> Ordering Source # (<) :: Name -> Name -> Bool Source # (<=) :: Name -> Name -> Bool Source # (>) :: Name -> Name -> Bool Source # (>=) :: Name -> Name -> Bool Source # max :: Name -> Name -> Name Source # min :: Name -> Name -> Name Source #
type Rep Name Source # |

Instance details

Defined in Data.XML.Types

type Rep Name = D1 ('MetaData "Name" "Data.XML.Types" "xml-types-0.3.8-CPraXujWO7hCdGwznbCwrz" 'False) (C1 ('MetaCons "Name" 'PrefixI 'True) (S1 ('MetaSel ('Just "nameLocalName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: (S1 ('MetaSel ('Just "nameNamespace") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "namePrefix") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text)))))

## Doctypes

data Doctype Source #

Note: due to the incredible complexity of DTDs, this type only supports external subsets. I've tried adding internal subset types, but they quickly gain more code than the rest of this module put together.

It is possible that some future version of this library might support internal subsets, but I am no longer actively working on adding them.

Constructors

Doctype |

Fields

- doctypeName :: Text
- doctypeID :: Maybe ExternalID

#### Instances

Instances details

NFData Doctype Source # |
Instance details Defined in Data.XML.Types Methods rnf :: Doctype -> () Source #
Data Doctype Source # |

Instance details

Defined in Data.XML.Types

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Doctype -> c Doctype Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Doctype Source #

toConstr :: Doctype -> Constr Source #

dataTypeOf :: Doctype -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Doctype) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Doctype) Source #

gmapT :: (forall b. Data b => b -> b) -> Doctype -> Doctype Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Doctype -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Doctype -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> Doctype -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Doctype -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Doctype -> m Doctype Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Doctype -> m Doctype Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Doctype -> m Doctype Source #

Generic Doctype Source # |

Instance details

Defined in Data.XML.Types

Associated Types

type Rep Doctype |

Instance details

Defined in Data.XML.Types

type Rep Doctype = D1 ('MetaData "Doctype" "Data.XML.Types" "xml-types-0.3.8-CPraXujWO7hCdGwznbCwrz" 'False) (C1 ('MetaCons "Doctype" 'PrefixI 'True) (S1 ('MetaSel ('Just "doctypeName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "doctypeID") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe ExternalID))))

Methods

from :: Doctype -> Rep Doctype x Source #

to :: Rep Doctype x -> Doctype Source #

Show Doctype Source # |
Instance details Defined in Data.XML.Types Methods showsPrec :: Int -> Doctype -> ShowS Source # show :: Doctype -> String Source # showList :: [Doctype] -> ShowS Source #
Eq Doctype Source # |
Instance details Defined in Data.XML.Types Methods (==) :: Doctype -> Doctype -> Bool Source # (/=) :: Doctype -> Doctype -> Bool Source #
Ord Doctype Source # |
Instance details Defined in Data.XML.Types Methods compare :: Doctype -> Doctype -> Ordering Source # (<) :: Doctype -> Doctype -> Bool Source # (<=) :: Doctype -> Doctype -> Bool Source # (>) :: Doctype -> Doctype -> Bool Source # (>=) :: Doctype -> Doctype -> Bool Source # max :: Doctype -> Doctype -> Doctype Source # min :: Doctype -> Doctype -> Doctype Source #
type Rep Doctype Source # |

Instance details

Defined in Data.XML.Types

type Rep Doctype = D1 ('MetaData "Doctype" "Data.XML.Types" "xml-types-0.3.8-CPraXujWO7hCdGwznbCwrz" 'False) (C1 ('MetaCons "Doctype" 'PrefixI 'True) (S1 ('MetaSel ('Just "doctypeName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "doctypeID") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe ExternalID))))

data ExternalID Source #

Constructors

SystemID Text |
PublicID Text Text |

#### Instances

Instances details

NFData ExternalID Source # |
Instance details Defined in Data.XML.Types Methods rnf :: ExternalID -> () Source #
Data ExternalID Source # |

Instance details

Defined in Data.XML.Types

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ExternalID -> c ExternalID Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ExternalID Source #

toConstr :: ExternalID -> Constr Source #

dataTypeOf :: ExternalID -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c ExternalID) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ExternalID) Source #

gmapT :: (forall b. Data b => b -> b) -> ExternalID -> ExternalID Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ExternalID -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ExternalID -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> ExternalID -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> ExternalID -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> ExternalID -> m ExternalID Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ExternalID -> m ExternalID Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ExternalID -> m ExternalID Source #

Generic ExternalID Source # |

Instance details

Defined in Data.XML.Types

Associated Types

type Rep ExternalID |

Instance details

Defined in Data.XML.Types

type Rep ExternalID = D1 ('MetaData "ExternalID" "Data.XML.Types" "xml-types-0.3.8-CPraXujWO7hCdGwznbCwrz" 'False) (C1 ('MetaCons "SystemID" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)) :+: C1 ('MetaCons "PublicID" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))

Methods

from :: ExternalID -> Rep ExternalID x Source #

to :: Rep ExternalID x -> ExternalID Source #

Show ExternalID Source # |
Instance details Defined in Data.XML.Types Methods showsPrec :: Int -> ExternalID -> ShowS Source # show :: ExternalID -> String Source # showList :: [ExternalID] -> ShowS Source #
Eq ExternalID Source # |
Instance details Defined in Data.XML.Types Methods (==) :: ExternalID -> ExternalID -> Bool Source # (/=) :: ExternalID -> ExternalID -> Bool Source #
Ord ExternalID Source # |

Instance details

Defined in Data.XML.Types

Methods

compare :: ExternalID -> ExternalID -> Ordering Source #

(<) :: ExternalID -> ExternalID -> Bool Source #

(<=) :: ExternalID -> ExternalID -> Bool Source #

(>) :: ExternalID -> ExternalID -> Bool Source #

(>=) :: ExternalID -> ExternalID -> Bool Source #

max :: ExternalID -> ExternalID -> ExternalID Source #

min :: ExternalID -> ExternalID -> ExternalID Source #

type Rep ExternalID Source # |

Instance details

Defined in Data.XML.Types

type Rep ExternalID = D1 ('MetaData "ExternalID" "Data.XML.Types" "xml-types-0.3.8-CPraXujWO7hCdGwznbCwrz" 'False) (C1 ('MetaCons "SystemID" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)) :+: C1 ('MetaCons "PublicID" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))

## Incremental processing

data Event Source #

Some XML processing tools are incremental, and work in terms of events rather than node trees. The `Event` type allows a document to be fully specified as a sequence of events.

Event-based XML libraries include:

- http://hackage.haskell.org/package/xml-enumerator
- http://hackage.haskell.org/package/libxml-enumerator
- http://hackage.haskell.org/package/expat-enumerator

Constructors

EventBeginDocument |
EventEndDocument |
EventBeginDoctype Text (Maybe ExternalID) |
EventEndDoctype |
EventInstruction Instruction |
EventBeginElement Name [(Name, [Content])] |
EventEndElement Name |
EventContent Content |
EventComment Text |
EventCDATA Text |

#### Instances

Instances details

NFData Event Source # |
Instance details Defined in Data.XML.Types Methods rnf :: Event -> () Source #
Data Event Source # |

Instance details

Defined in Data.XML.Types

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Event -> c Event Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Event Source #

toConstr :: Event -> Constr Source #

dataTypeOf :: Event -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Event) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Event) Source #

gmapT :: (forall b. Data b => b -> b) -> Event -> Event Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Event -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Event -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> Event -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Event -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Event -> m Event Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Event -> m Event Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Event -> m Event Source #

Generic Event Source # |

Instance details

Defined in Data.XML.Types

Associated Types

type Rep Event |

Instance details

Defined in Data.XML.Types

type Rep Event = D1 ('MetaData "Event" "Data.XML.Types" "xml-types-0.3.8-CPraXujWO7hCdGwznbCwrz" 'False) (((C1 ('MetaCons "EventBeginDocument" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "EventEndDocument" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "EventBeginDoctype" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe ExternalID))) :+: (C1 ('MetaCons "EventEndDoctype" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "EventInstruction" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Instruction))))) :+: ((C1 ('MetaCons "EventBeginElement" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Name) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [(Name, [Content])])) :+: C1 ('MetaCons "EventEndElement" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Name))) :+: (C1 ('MetaCons "EventContent" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Content)) :+: (C1 ('MetaCons "EventComment" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)) :+: C1 ('MetaCons "EventCDATA" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text))))))

Methods

from :: Event -> Rep Event x Source #

to :: Rep Event x -> Event Source #

Show Event Source # |
Instance details Defined in Data.XML.Types Methods showsPrec :: Int -> Event -> ShowS Source # show :: Event -> String Source # showList :: [Event] -> ShowS Source #
Eq Event Source # |
Instance details Defined in Data.XML.Types Methods (==) :: Event -> Event -> Bool Source # (/=) :: Event -> Event -> Bool Source #
Ord Event Source # |
Instance details Defined in Data.XML.Types Methods compare :: Event -> Event -> Ordering Source # (<) :: Event -> Event -> Bool Source # (<=) :: Event -> Event -> Bool Source # (>) :: Event -> Event -> Bool Source # (>=) :: Event -> Event -> Bool Source # max :: Event -> Event -> Event Source # min :: Event -> Event -> Event Source #
type Rep Event Source # |

Instance details

Defined in Data.XML.Types

type Rep Event = D1 ('MetaData "Event" "Data.XML.Types" "xml-types-0.3.8-CPraXujWO7hCdGwznbCwrz" 'False) (((C1 ('MetaCons "EventBeginDocument" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "EventEndDocument" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "EventBeginDoctype" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe ExternalID))) :+: (C1 ('MetaCons "EventEndDoctype" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "EventInstruction" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Instruction))))) :+: ((C1 ('MetaCons "EventBeginElement" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Name) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [(Name, [Content])])) :+: C1 ('MetaCons "EventEndElement" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Name))) :+: (C1 ('MetaCons "EventContent" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Content)) :+: (C1 ('MetaCons "EventComment" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)) :+: C1 ('MetaCons "EventCDATA" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text))))))

# Combinators

## Filters

isElement :: Node -> [Element] Source #

isInstruction :: Node -> [Instruction] Source #

isContent :: Node -> [Content] Source #

isComment :: Node -> [Text] Source #

isNamed :: Name -> Element -> [Element] Source #

## Element traversal

elementChildren :: Element -> [Element] Source #

elementContent :: Element -> [Content] Source #

elementText :: Element -> [Text] Source #

## Node traversal

nodeChildren :: Node -> [Node] Source #

nodeContent :: Node -> [Content] Source #

nodeText :: Node -> [Text] Source #

## Attributes

hasAttribute :: Name -> Element -> [Element] Source #

hasAttributeText :: Name -> (Text -> Bool) -> Element -> [Element] Source #

attributeContent :: Name -> Element -> Maybe [Content] Source #

attributeText :: Name -> Element -> Maybe Text Source #