Safe Haskell | None |
---|---|
Language | Haskell2010 |
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
- module Data.XML.Parser.Low.Entity
- module Data.XML.Parser.Low.Name
- module Data.XML.Parser.Low.Reference
- data Content
- expandContent :: Alternative m => EntityDecoder -> Content -> m Text
- expandContents :: Alternative m => Monad m => EntityDecoder -> [Content] -> m Text
- tokenSingleQuote :: CharParsing m => m Char
- tokenDoubleQuote :: CharParsing m => m Char
- tokenQuote :: CharParsing m => m Char
- tokenWhitespace :: CharParsing m => m String
- tokenEqual :: CharParsing m => Monad m => m ()
- tokenContent :: CharParsing m => Monad m => String -> m Content
- tokenInstructionOpen :: CharParsing m => Monad m => m Text
- tokenInstructionClose :: CharParsing m => m ()
- tokenCdataOpen :: CharParsing m => m ()
- tokenCdataClose :: CharParsing m => m ()
- tokenCommentOpen :: CharParsing m => m ()
- tokenCommentClose :: CharParsing m => m ()
- tokenDoctypeOpen :: CharParsing m => m ()
- tokenXmlDeclarationOpen :: CharParsing m => m ()
- tokenXmlDeclarationClose :: CharParsing m => m ()
- tokenEmptyElementTagClose :: CharParsing m => m ()
- tokenStartTagOpen :: CharParsing m => Monad m => m QName
- tokenEndTagOpen :: CharParsing m => Monad m => m QName
- tokenElementClose :: CharParsing m => m ()
- module Data.XML.InternalSubset.Parser.Low
Documentation
module Data.XML.Parser.Low.Entity
module Data.XML.Parser.Low.Name
Raw text or reference.
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.
tokenSingleQuote :: CharParsing m => m Char Source #
'
tokenDoubleQuote :: CharParsing m => m Char Source #
"
tokenQuote :: CharParsing m => m Char Source #
Single or double quote.
tokenEqual :: CharParsing m => Monad m => m () Source #
tokenContent :: CharParsing m => Monad m => String -> m Content Source #
tokenInstructionOpen :: CharParsing m => Monad m => m Text Source #
Return processing instruction name.
>>>
parseOnly tokenInstructionOpen "<?php"
Right "php"
tokenInstructionClose :: CharParsing m => m () Source #
?>
tokenCdataOpen :: CharParsing m => m () Source #
tokenCdataClose :: CharParsing m => m () Source #
tokenCommentOpen :: CharParsing m => m () Source #
<!--
tokenCommentClose :: CharParsing m => m () Source #
-->
tokenDoctypeOpen :: CharParsing m => m () Source #
<!DOCTYPE
tokenXmlDeclarationOpen :: CharParsing m => m () Source #
<?xml
tokenXmlDeclarationClose :: CharParsing m => m () Source #
?>
tokenEmptyElementTagClose :: CharParsing m => m () Source #
/>
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"})
tokenElementClose :: CharParsing m => m () Source #
>