Text.XML.Expat.Internal.IO

hexpat-0.20.9: XML parser/formatter based on expat

Safe Haskell | None
Language | Haskell98

Text.XML.Expat.Internal.IO

Description

Low-level interface to Expat. Unless speed is paramount, this should normally be avoided in favour of the interfaces provided by `SAX` and `Tree`, etc.

Synopsis

- type HParser = ByteString -> Bool -> IO (ForeignPtr Word8, CInt, Maybe XMLParseError)
- hexpatNewParser :: Maybe Encoding -> Maybe (ByteString -> Maybe ByteString) -> Bool -> IO (HParser, IO XMLParseLocation)
- encodingToString :: Encoding -> String
- data Encoding
  - = ASCII
  - | UTF8
  - | UTF16
  - | ISO88591
- data XMLParseError = XMLParseError String XMLParseLocation
- data XMLParseLocation = XMLParseLocation {
  - xmlLineNumber :: Int64
  - xmlColumnNumber :: Int64
  - xmlByteIndex :: Int64
  - xmlByteCount :: Int64
  }

# Documentation

type HParser = ByteString -> Bool -> IO (ForeignPtr Word8, CInt, Maybe XMLParseError)

hexpatNewParser

Arguments

:: Maybe Encoding |
-> Maybe (ByteString -> Maybe ByteString) | Entity decoder
-> Bool | Whether to include input locations
-> IO (HParser, IO XMLParseLocation) |

encodingToString :: Encoding -> String

data Encoding

Constructors

ASCII |
UTF8 |
UTF16 |
ISO88591 |

data XMLParseError

Parse error, consisting of message text and error location

Constructors

XMLParseError String XMLParseLocation |

Instances

Eq XMLParseError |
Show XMLParseError |
NFData XMLParseError |

data XMLParseLocation

Specifies a location of an event within the input text

Constructors

XMLParseLocation |
Fields xmlLineNumber :: Int64 Line number of the event xmlColumnNumber :: Int64 Column number of the event xmlByteIndex :: Int64 Byte index of event from start of document xmlByteCount :: Int64 The number of bytes in the event

Instances

Eq XMLParseLocation |
Show XMLParseLocation |
NFData XMLParseLocation |