Portability | portable |
---|---|
Maintainer | Yitzchak Gale <gale@sefer.org> |
Safe Haskell | Safe-Infered |
This module provides a Data.Attoparsec.Text parser for XML Document Type Declaration (DTD) documents. A higher-level interface that implements parameter entity resolution is also provided.
- dtd :: Parser DTD
- textDecl :: Parser DTDTextDecl
- dtdComponent :: Parser DTDComponent
- entityDecl :: Parser EntityDecl
- entityValue :: Parser [EntityValue]
- pERef :: Parser PERef
- notation :: Parser Notation
- notationSrc :: Parser NotationSource
- elementDecl :: Parser ElementDecl
- contentDecl :: Parser ContentDecl
- contentModel :: Parser ContentModel
- repeatChar :: Parser Repeat
- attList :: Parser AttList
- attDecl :: Parser AttDecl
- attDeclPERef :: Parser AttDeclPERef
- attType :: Parser AttType
- attDefault :: Parser AttDefault
- instruction :: Parser Instruction
- comment :: Parser Text
- externalID :: Parser ExternalID
- name :: Parser Text
- nameSS :: Parser Text
- quoted :: Parser Text
- skipWS :: Parser ()
- ws :: Parser Char
Parsing a DTD
Parse a DTD. Parameter entity substitution is not supported by this parser, so parameter entities cannot appear in places where a valid DTD syntax production cannot be determined without resolving them.
Top-level DTD structure
textDecl :: Parser DTDTextDeclSource
Parse an ?xml
text declaration at the beginning of a DTD
.
dtdComponent :: Parser DTDComponentSource
Parse a single component of a DTD
. Conditional sections are
currently not supported.
Entity declarations and references
entityDecl :: Parser EntityDeclSource
Parse an entity declaration.
entityValue :: Parser [EntityValue]Source
Parse an entity value. An entity value is a quoted string possibly containing parameter entity references.
notationSrc :: Parser NotationSourceSource
Parse a source for a notation.
Element declarations
elementDecl :: Parser ElementDeclSource
Parse the declaration of an element.
contentDecl :: Parser ContentDeclSource
Parse the content that can occur in an element.
contentModel :: Parser ContentModelSource
Parse the model of structured content for an element.
repeatChar :: Parser RepeatSource
Parse a repetition character.
Attribute declarations
attDefault :: Parser AttDefaultSource
Parse a default value specification for an attribute.
Declarations of comments and processing instructions
instruction :: Parser InstructionSource
Parse a processing instruction.
Parsing combinators for general DTD syntax
externalID :: Parser ExternalIDSource
Parse an external ID.
Parse a DTD name. We are much more liberal than the spec: we
allow any characters that will not interfere with other DTD
syntax. This parser subsumes both Name
and NmToken
in the spec,
and more.
A single-quoted or double-quoted string. The quotation marks are dropped.