module Data.DTD.Types
(
DTD (..)
, DTDTextDecl (..)
, DTDComponent (..)
, EntityDecl (..)
, ElementDecl (..)
, ContentDecl (..)
, ContentModel (..)
, Repeat (..)
, AttList (..)
, AttDecl (..)
, AttType (..)
, AttDefault (..)
, Notation (..)
, NotationSource (..)
)
where
import Data.DTD.Types.Unresolved
( DTDTextDecl (..)
, ContentModel (..)
, Repeat (..)
, AttType (..)
, AttDefault (..)
, Notation (..)
, NotationSource (..)
)
import Data.Typeable (Typeable)
import Data.Text (Text)
import Data.XML.Types (ExternalID, Instruction)
data AttList =
AttList
{ attListElementName :: Text
, attListDecls :: [AttDecl]
}
deriving (Show, Eq, Typeable)
data ContentDecl =
ContentEmpty
| ContentAny
| ContentElement ContentModel
| ContentMixed [Text]
deriving (Show, Eq, Typeable)
data ElementDecl =
ElementDecl
{ eltDeclName :: Text
, eltDeclContent :: ContentDecl
}
deriving (Show, Eq, Typeable)
data EntityDecl =
InternalGeneralEntityDecl
{ entityDeclName :: Text
, entityDeclValue :: Text
}
| ExternalGeneralEntityDecl
{ entityDeclName :: Text
, entityDeclID :: ExternalID
, entityDeclNotation :: Maybe Text
}
deriving (Show, Eq, Typeable)
data DTDComponent =
DTDEntityDecl EntityDecl
| DTDElementDecl ElementDecl
| DTDAttList AttList
| DTDNotation Notation
| DTDInstruction Instruction
| DTDComment Text
deriving (Show, Eq, Typeable)
data DTD = DTD
{ dtdTextDecl :: Maybe DTDTextDecl
, dtdComponents :: [DTDComponent]
}
deriving (Show, Eq, Typeable)
data AttDecl =
AttDecl
{ attDeclName :: Text
, attDeclType :: AttType
, attDeclDefault :: AttDefault
}
deriving (Show, Eq)