Safe Haskell | None |
---|---|
Language | Haskell2010 |
Document type declaration parsers.
https://www.w3.org/TR/REC-xml/#dt-doctype
All documentation examples assume the following setup:
:set -XOverloadedStrings import Data.Attoparsec.ByteString
Synopsis
- data ExternalID
- externalID :: CharParsing m => Monad m => m ExternalID
- data GeneralEntityDeclaration = GeneralEntityDeclaration Text [Content]
- generalEntityDeclaration :: CharParsing m => Monad m => m GeneralEntityDeclaration
- data Doctype = Doctype Text (Maybe ExternalID) [GeneralEntityDeclaration]
- doctype :: CharParsing m => Monad m => m Doctype
Documentation
data ExternalID Source #
External entity identifier
Instances
Eq ExternalID Source # | |
Defined in Data.XML.Parser.Mid.Doctype (==) :: ExternalID -> ExternalID -> Bool # (/=) :: ExternalID -> ExternalID -> Bool # | |
Ord ExternalID Source # | |
Defined in Data.XML.Parser.Mid.Doctype compare :: ExternalID -> ExternalID -> Ordering # (<) :: ExternalID -> ExternalID -> Bool # (<=) :: ExternalID -> ExternalID -> Bool # (>) :: ExternalID -> ExternalID -> Bool # (>=) :: ExternalID -> ExternalID -> Bool # max :: ExternalID -> ExternalID -> ExternalID # min :: ExternalID -> ExternalID -> ExternalID # | |
Read ExternalID Source # | |
Defined in Data.XML.Parser.Mid.Doctype readsPrec :: Int -> ReadS ExternalID # readList :: ReadS [ExternalID] # readPrec :: ReadPrec ExternalID # readListPrec :: ReadPrec [ExternalID] # | |
Show ExternalID Source # | |
Defined in Data.XML.Parser.Mid.Doctype showsPrec :: Int -> ExternalID -> ShowS # show :: ExternalID -> String # showList :: [ExternalID] -> ShowS # |
externalID :: CharParsing m => Monad m => m ExternalID Source #
https://www.w3.org/TR/REC-xml/#NT-ExternalID
>>>
parseOnly externalID "PUBLIC '-//Textuality//TEXT Standard open-hatch boilerplate//EN' 'http://www.textuality.com/boilerplate/OpenHatch.xml'"
Right (PublicID "-//Textuality//TEXT Standard open-hatch boilerplate//EN" "http://www.textuality.com/boilerplate/OpenHatch.xml")>>>
parseOnly externalID "SYSTEM '../grafix/OpenHatch.gif'"
Right (SystemID "../grafix/OpenHatch.gif")
data GeneralEntityDeclaration Source #
Instances
generalEntityDeclaration :: CharParsing m => Monad m => m GeneralEntityDeclaration Source #
https://www.w3.org/TR/REC-xml/#NT-GEDecl
>>>
parseOnly generalEntityDeclaration "<!ENTITY d '
'>"
Right (GeneralEntityDeclaration "d" [ContentReference (CharRef '\r')])>>>
parseOnly generalEntityDeclaration "<!ENTITY da '
'>"
Right (GeneralEntityDeclaration "da" [ContentReference (CharRef '\r'),ContentReference (CharRef '\n')])>>>
parseOnly generalEntityDeclaration "<!ENTITY Pub-Status 'This is a pre-release of the specification.'>"
Right (GeneralEntityDeclaration "Pub-Status" [ContentText "This is a pre-release of the specification."])
doctype :: CharParsing m => Monad m => m Doctype Source #
https://www.w3.org/TR/REC-xml/#NT-doctypedecl
>>>
parseOnly doctype "<!DOCTYPE greeting SYSTEM 'hello.dtd'>"
Right (Doctype "greeting" (Just (SystemID "hello.dtd")) [])>>>
parseOnly doctype "<!DOCTYPE foo [ <!ENTITY x '<'> ]>"
Right (Doctype "foo" Nothing [GeneralEntityDeclaration "x" [ContentReference (EntityRef "lt")]])