Safe Haskell | None |
---|---|
Language | Haskell2010 |
Low-level parsers for XML references.
All documentation examples assume the following setup:
:set -XOverloadedStrings import Data.Attoparsec.ByteString
Synopsis
- data Reference
- expandReference :: Alternative m => EntityDecoder -> Reference -> m Text
- expandReference' :: Reference -> Maybe Text
- tokenReference :: CharParsing m => Monad m => m Reference
Documentation
>>>
:set -XOverloadedStrings
>>>
import Data.Attoparsec.ByteString
https://www.w3.org/TR/REC-xml/#dt-entref
Entity reference, or character reference.
expandReference :: Alternative m => EntityDecoder -> Reference -> m Text Source #
Resolve reference into raw text.
expandReference' :: Reference -> Maybe Text Source #
Same as expandReference decodePredefinedEntities
, provided for convenience.
tokenReference :: CharParsing m => Monad m => m Reference Source #
https://www.w3.org/TR/REC-xml/#NT-Reference
>>>
parseOnly tokenReference "<"
Right (CharRef '<')>>>
parseOnly tokenReference "&docdate;"
Right (EntityRef "docdate")