hextream-0.3.0.0: Streaming-friendly XML parsers
Safe HaskellNone
LanguageHaskell2010

Data.XML.Parser.Low

Description

Low-level XML parsers:

  • parsed tokens are small and may overlap; it is not possible to tokenize XML document in a stateless way
  • parsers are reversible: all formatting details are retained (e.g. whitespacing)

All documentation examples assume the following setup:

:set -XOverloadedStrings
import Data.Attoparsec.ByteString
Synopsis

Documentation

data Content Source #

Raw text or reference.

Instances

Instances details
Eq Content Source # 
Instance details

Defined in Data.XML.Parser.Low

Methods

(==) :: Content -> Content -> Bool #

(/=) :: Content -> Content -> Bool #

Ord Content Source # 
Instance details

Defined in Data.XML.Parser.Low

Read Content Source # 
Instance details

Defined in Data.XML.Parser.Low

Show Content Source # 
Instance details

Defined in Data.XML.Parser.Low

expandContent :: Alternative m => EntityDecoder -> Content -> m Text Source #

Expand content reference, if any.

expandContents :: Alternative m => Monad m => EntityDecoder -> [Content] -> m Text Source #

Same as expandContent, but on a list. Provided for convenience.

tokenQuote :: CharParsing m => m Char Source #

Single or double quote.

tokenInstructionOpen :: CharParsing m => Monad m => m Text Source #

Return processing instruction name.

>>> parseOnly tokenInstructionOpen "<?php"
Right "php"

tokenDoctypeOpen :: CharParsing m => m () Source #

<!DOCTYPE

tokenStartTagOpen :: CharParsing m => Monad m => m QName Source #

Return tag name.

>>> parseOnly tokenStartTagOpen "<foo"
Right (QName {namePrefix = "", nameLocal = "foo"})

tokenEndTagOpen :: CharParsing m => Monad m => m QName Source #

Return tag name.

>>> parseOnly tokenEndTagOpen "</foo"
Right (QName {namePrefix = "", nameLocal = "foo"})