hexpat-0.20.13: 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) Source #

hexpatNewParser Source #

Arguments

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

encodingToString :: Encoding -> String Source #

data Encoding Source #

Constructors

ASCII |
UTF8 |
UTF16 |
ISO88591 |

data XMLParseError Source #

Parse error, consisting of message text and error location

Constructors

XMLParseError String XMLParseLocation |

#### Instances

Instances details

NFData XMLParseError Source # |
Instance details Defined in Text.XML.Expat.Internal.IO Methods rnf :: XMLParseError -> () Source #
Show XMLParseError Source # |
Instance details Defined in Text.XML.Expat.Internal.IO Methods showsPrec :: Int -> XMLParseError -> ShowS Source # show :: XMLParseError -> String Source # showList :: [XMLParseError] -> ShowS Source #
Eq XMLParseError Source # |
Instance details Defined in Text.XML.Expat.Internal.IO Methods (==) :: XMLParseError -> XMLParseError -> Bool Source # (/=) :: XMLParseError -> XMLParseError -> Bool Source #

data XMLParseLocation Source #

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

Instances details

NFData XMLParseLocation Source # |
Instance details Defined in Text.XML.Expat.Internal.IO Methods rnf :: XMLParseLocation -> () Source #
Show XMLParseLocation Source # |
Instance details Defined in Text.XML.Expat.Internal.IO Methods showsPrec :: Int -> XMLParseLocation -> ShowS Source # show :: XMLParseLocation -> String Source # showList :: [XMLParseLocation] -> ShowS Source #
Eq XMLParseLocation Source # |
Instance details Defined in Text.XML.Expat.Internal.IO Methods (==) :: XMLParseLocation -> XMLParseLocation -> Bool Source # (/=) :: XMLParseLocation -> XMLParseLocation -> Bool Source #