    {- |
       This module defines an internal (generic) representation for XML
       documents including their DTDs.

       History:
       The original module was derived by hand from the XML specification,
       following the grammar precisely.  Then we simplified the types,
       removing layers of indirection and redundancy, and generally making
       things easier to work with.  Then we allowed PEReferences to be
       ubiquitous, by removing them from the types and resolving all
       PE references at parse-time.  Finally, we added a per-document
       symbol table for GEReferences, and a whitespace-significance flag
       for plaintext.
    -}

    module Text.XML.HaXml.Types
      (
      -- * A simple symbol table mapping strings (references) to values.
        SymTab
      -- ** Symbol table operations
      , emptyST
      , addST
      , lookupST

      -- * XML Types
      -- ** The top-level document container
      , Document(..)

      -- ** The main document content
      , Element(..)
      , ElemTag(..)
      , Content(..)
      , Attribute
      , AttValue(..)
      , info

      -- ** Administrative parts of the document
      , Prolog(..)
      , XMLDecl(..)
      , Misc(..)
      , ProcessingInstruction
      , SDDecl
      , VersionInfo
      , Comment
      , PITarget

      -- ** The DTD
      -- *** content model
      , DocTypeDecl(..)
      , MarkupDecl(..)
      , ExtSubset(..)
      , ExtSubsetDecl(..)
      , ElementDecl(..)
      , ContentSpec(..)
      , CP(..)
      , Modifier(..)
      , Mixed(..)

      -- *** attribute model
      , AttListDecl(..)
      , AttDef(..)
      , AttType(..)
      , TokenizedType(..)
      , EnumeratedType(..)
      , NotationType
      , Enumeration
      , DefaultDecl(..)
      , FIXED(..)

      -- *** conditional sections
      , ConditionalSect(..)
      , IncludeSect
      , IgnoreSect
      , Ignore(..)
      , IgnoreSectContents(..)

      -- ** References
      , Reference(..)
      , EntityRef
      , CharRef
      , PEReference

      -- ** Entities
      , EntityDecl(..)
      , GEDecl(..)
      , PEDecl(..)
      , EntityDef(..)
      , PEDef(..)
      , ExternalID(..)
      , NDataDecl(..)
      , TextDecl(..)
      , ExtParsedEnt(..)
      , ExtPE(..)
      , NotationDecl(..)
      , PublicID(..)
      , EncodingDecl(..)
      , EntityValue(..)
      , EV(..)
      , PubidLiteral(..)
      , SystemLiteral(..)

      -- ** Namespaces
      , QName(..)
      , Namespace(..)

      -- ** Basic value types
      , Name
      , Names
      , NmToken
      , NmTokens
      , CharData
      , CDSect
      ) where

    {- A simple symbol table for storing macros whilst parsing. -}

    type SymTab a = [(String,a)]

    emptyST :: SymTab a
    emptyST :: forall a. SymTab a
    emptyST  = []

    addST :: String -> a -> SymTab a -> SymTab a
    addST :: forall a. String -> a -> SymTab a -> SymTab a
    addST String
    n a
    v = ((String
    n,a
    v)(String, a) -> [(String, a)] -> [(String, a)]
    forall a. a -> [a] -> [a]
    :)

    lookupST :: String -> SymTab a -> Maybe a
    lookupST :: forall a. String -> SymTab a -> Maybe a
    lookupST = String -> [(String, a)] -> Maybe a
    forall a b. Eq a => a -> [(a, b)] -> Maybe b
    lookup

    {- XML types start here -}

    -- | The symbol table stored in a document holds all its general entity
    --   reference definitions.
    data Document i = Document Prolog (SymTab EntityDef) (Element i) [Misc]
                      deriving (Document i -> Document i -> Bool
    (Document i -> Document i -> Bool)
    -> (Document i -> Document i -> Bool) -> Eq (Document i)
    forall i. Document i -> Document i -> Bool
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: forall i. Document i -> Document i -> Bool
    == :: Document i -> Document i -> Bool
    $c/= :: forall i. Document i -> Document i -> Bool
    /= :: Document i -> Document i -> Bool
    Eq, Int -> Document i -> ShowS
    [Document i] -> ShowS
    Document i -> String
    (Int -> Document i -> ShowS)
    -> (Document i -> String)
    -> ([Document i] -> ShowS)
    -> Show (Document i)
    forall i. Show i => Int -> Document i -> ShowS
    forall i. Show i => [Document i] -> ShowS
    forall i. Show i => Document i -> String
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: forall i. Show i => Int -> Document i -> ShowS
    showsPrec :: Int -> Document i -> ShowS
    $cshow :: forall i. Show i => Document i -> String
    show :: Document i -> String
    $cshowList :: forall i. Show i => [Document i] -> ShowS
    showList :: [Document i] -> ShowS
    Show)
    data Prolog     = Prolog (Maybe XMLDecl) [Misc] (Maybe DocTypeDecl) [Misc]
                      deriving (Prolog -> Prolog -> Bool
    (Prolog -> Prolog -> Bool)
    -> (Prolog -> Prolog -> Bool) -> Eq Prolog
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: Prolog -> Prolog -> Bool
    == :: Prolog -> Prolog -> Bool
    $c/= :: Prolog -> Prolog -> Bool
    /= :: Prolog -> Prolog -> Bool
    Eq, Int -> Prolog -> ShowS
    [Prolog] -> ShowS
    Prolog -> String
    (Int -> Prolog -> ShowS)
    -> (Prolog -> String) -> ([Prolog] -> ShowS) -> Show Prolog
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> Prolog -> ShowS
    showsPrec :: Int -> Prolog -> ShowS
    $cshow :: Prolog -> String
    show :: Prolog -> String
    $cshowList :: [Prolog] -> ShowS
    showList :: [Prolog] -> ShowS
    Show)
    data XMLDecl    = XMLDecl VersionInfo (Maybe EncodingDecl) (Maybe SDDecl)
                      deriving (XMLDecl -> XMLDecl -> Bool
    (XMLDecl -> XMLDecl -> Bool)
    -> (XMLDecl -> XMLDecl -> Bool) -> Eq XMLDecl
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: XMLDecl -> XMLDecl -> Bool
    == :: XMLDecl -> XMLDecl -> Bool
    $c/= :: XMLDecl -> XMLDecl -> Bool
    /= :: XMLDecl -> XMLDecl -> Bool
    Eq, Int -> XMLDecl -> ShowS
    [XMLDecl] -> ShowS
    XMLDecl -> String
    (Int -> XMLDecl -> ShowS)
    -> (XMLDecl -> String) -> ([XMLDecl] -> ShowS) -> Show XMLDecl
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> XMLDecl -> ShowS
    showsPrec :: Int -> XMLDecl -> ShowS
    $cshow :: XMLDecl -> String
    show :: XMLDecl -> String
    $cshowList :: [XMLDecl] -> ShowS
    showList :: [XMLDecl] -> ShowS
    Show)
    data Misc       = Comment Comment
                    | PI ProcessingInstruction
                    deriving (Misc -> Misc -> Bool
    (Misc -> Misc -> Bool) -> (Misc -> Misc -> Bool) -> Eq Misc
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: Misc -> Misc -> Bool
    == :: Misc -> Misc -> Bool
    $c/= :: Misc -> Misc -> Bool
    /= :: Misc -> Misc -> Bool
    Eq, Int -> Misc -> ShowS
    [Misc] -> ShowS
    Misc -> String
    (Int -> Misc -> ShowS)
    -> (Misc -> String) -> ([Misc] -> ShowS) -> Show Misc
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> Misc -> ShowS
    showsPrec :: Int -> Misc -> ShowS
    $cshow :: Misc -> String
    show :: Misc -> String
    $cshowList :: [Misc] -> ShowS
    showList :: [Misc] -> ShowS
    Show)

    type ProcessingInstruction = (PITarget,String)

    type SDDecl      = Bool
    type VersionInfo = String
    type Comment     = String
    type PITarget    = String

    data DocTypeDecl = DTD QName (Maybe ExternalID) [MarkupDecl]  deriving (DocTypeDecl -> DocTypeDecl -> Bool
    (DocTypeDecl -> DocTypeDecl -> Bool)
    -> (DocTypeDecl -> DocTypeDecl -> Bool) -> Eq DocTypeDecl
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: DocTypeDecl -> DocTypeDecl -> Bool
    == :: DocTypeDecl -> DocTypeDecl -> Bool
    $c/= :: DocTypeDecl -> DocTypeDecl -> Bool
    /= :: DocTypeDecl -> DocTypeDecl -> Bool
    Eq, Int -> DocTypeDecl -> ShowS
    [DocTypeDecl] -> ShowS
    DocTypeDecl -> String
    (Int -> DocTypeDecl -> ShowS)
    -> (DocTypeDecl -> String)
    -> ([DocTypeDecl] -> ShowS)
    -> Show DocTypeDecl
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> DocTypeDecl -> ShowS
    showsPrec :: Int -> DocTypeDecl -> ShowS
    $cshow :: DocTypeDecl -> String
    show :: DocTypeDecl -> String
    $cshowList :: [DocTypeDecl] -> ShowS
    showList :: [DocTypeDecl] -> ShowS
    Show)
    data MarkupDecl  = Element  ElementDecl
                     | AttList  AttListDecl
                     | Entity   EntityDecl
                     | Notation NotationDecl
                     | MarkupMisc Misc
                     deriving (MarkupDecl -> MarkupDecl -> Bool
    (MarkupDecl -> MarkupDecl -> Bool)
    -> (MarkupDecl -> MarkupDecl -> Bool) -> Eq MarkupDecl
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: MarkupDecl -> MarkupDecl -> Bool
    == :: MarkupDecl -> MarkupDecl -> Bool
    $c/= :: MarkupDecl -> MarkupDecl -> Bool
    /= :: MarkupDecl -> MarkupDecl -> Bool
    Eq, Int -> MarkupDecl -> ShowS
    [MarkupDecl] -> ShowS
    MarkupDecl -> String
    (Int -> MarkupDecl -> ShowS)
    -> (MarkupDecl -> String)
    -> ([MarkupDecl] -> ShowS)
    -> Show MarkupDecl
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> MarkupDecl -> ShowS
    showsPrec :: Int -> MarkupDecl -> ShowS
    $cshow :: MarkupDecl -> String
    show :: MarkupDecl -> String
    $cshowList :: [MarkupDecl] -> ShowS
    showList :: [MarkupDecl] -> ShowS
    Show)

    data ExtSubset     = ExtSubset (Maybe TextDecl) [ExtSubsetDecl]  deriving (ExtSubset -> ExtSubset -> Bool
    (ExtSubset -> ExtSubset -> Bool)
    -> (ExtSubset -> ExtSubset -> Bool) -> Eq ExtSubset
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: ExtSubset -> ExtSubset -> Bool
    == :: ExtSubset -> ExtSubset -> Bool
    $c/= :: ExtSubset -> ExtSubset -> Bool
    /= :: ExtSubset -> ExtSubset -> Bool
    Eq, Int -> ExtSubset -> ShowS
    [ExtSubset] -> ShowS
    ExtSubset -> String
    (Int -> ExtSubset -> ShowS)
    -> (ExtSubset -> String)
    -> ([ExtSubset] -> ShowS)
    -> Show ExtSubset
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> ExtSubset -> ShowS
    showsPrec :: Int -> ExtSubset -> ShowS
    $cshow :: ExtSubset -> String
    show :: ExtSubset -> String
    $cshowList :: [ExtSubset] -> ShowS
    showList :: [ExtSubset] -> ShowS
    Show)
    data ExtSubsetDecl = ExtMarkupDecl MarkupDecl
                       | ExtConditionalSect ConditionalSect
                       deriving (ExtSubsetDecl -> ExtSubsetDecl -> Bool
    (ExtSubsetDecl -> ExtSubsetDecl -> Bool)
    -> (ExtSubsetDecl -> ExtSubsetDecl -> Bool) -> Eq ExtSubsetDecl
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: ExtSubsetDecl -> ExtSubsetDecl -> Bool
    == :: ExtSubsetDecl -> ExtSubsetDecl -> Bool
    $c/= :: ExtSubsetDecl -> ExtSubsetDecl -> Bool
    /= :: ExtSubsetDecl -> ExtSubsetDecl -> Bool
    Eq, Int -> ExtSubsetDecl -> ShowS
    [ExtSubsetDecl] -> ShowS
    ExtSubsetDecl -> String
    (Int -> ExtSubsetDecl -> ShowS)
    -> (ExtSubsetDecl -> String)
    -> ([ExtSubsetDecl] -> ShowS)
    -> Show ExtSubsetDecl
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> ExtSubsetDecl -> ShowS
    showsPrec :: Int -> ExtSubsetDecl -> ShowS
    $cshow :: ExtSubsetDecl -> String
    show :: ExtSubsetDecl -> String
    $cshowList :: [ExtSubsetDecl] -> ShowS
    showList :: [ExtSubsetDecl] -> ShowS
    Show)

    data Element i = Elem QName [Attribute] [Content i] deriving (Element i -> Element i -> Bool
    (Element i -> Element i -> Bool)
    -> (Element i -> Element i -> Bool) -> Eq (Element i)
    forall i. Element i -> Element i -> Bool
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: forall i. Element i -> Element i -> Bool
    == :: Element i -> Element i -> Bool
    $c/= :: forall i. Element i -> Element i -> Bool
    /= :: Element i -> Element i -> Bool
    Eq, Int -> Element i -> ShowS
    [Element i] -> ShowS
    Element i -> String
    (Int -> Element i -> ShowS)
    -> (Element i -> String)
    -> ([Element i] -> ShowS)
    -> Show (Element i)
    forall i. Show i => Int -> Element i -> ShowS
    forall i. Show i => [Element i] -> ShowS
    forall i. Show i => Element i -> String
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: forall i. Show i => Int -> Element i -> ShowS
    showsPrec :: Int -> Element i -> ShowS
    $cshow :: forall i. Show i => Element i -> String
    show :: Element i -> String
    $cshowList :: forall i. Show i => [Element i] -> ShowS
    showList :: [Element i] -> ShowS
    Show)
    --  ElemTag is an intermediate type for parsing only
    data ElemTag   = ElemTag QName [Attribute]
    type Attribute = (QName, AttValue)
    data Content i = CElem (Element i) i
                   | CString Bool CharData i
                            -- ^ bool is whether whitespace is significant
                   | CRef Reference i
                   | CMisc Misc i
                   deriving Int -> Content i -> ShowS
    [Content i] -> ShowS
    Content i -> String
    (Int -> Content i -> ShowS)
    -> (Content i -> String)
    -> ([Content i] -> ShowS)
    -> Show (Content i)
    forall i. Show i => Int -> Content i -> ShowS
    forall i. Show i => [Content i] -> ShowS
    forall i. Show i => Content i -> String
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: forall i. Show i => Int -> Content i -> ShowS
    showsPrec :: Int -> Content i -> ShowS
    $cshow :: forall i. Show i => Content i -> String
    show :: Content i -> String
    $cshowList :: forall i. Show i => [Content i] -> ShowS
    showList :: [Content i] -> ShowS
    Show

    -- custom instance of Eq, ignoring the informational elements.
    instance Eq (Content i) where
        (CElem Element i
    e i
    _)     == :: Content i -> Content i -> Bool
    == (CElem Element i
    e' i
    _)       =  Element i
    eElement i -> Element i -> Bool
    forall a. Eq a => a -> a -> Bool
    ==Element i
    e'
        (CString Bool
    b String
    c i
    _) == (CString Bool
    b' String
    c' i
    _)  =  Bool
    bBool -> Bool -> Bool
    forall a. Eq a => a -> a -> Bool
    ==Bool
    b' Bool -> Bool -> Bool
    && String
    cString -> String -> Bool
    forall a. Eq a => a -> a -> Bool
    ==String
    c'
        (CRef Reference
    r i
    _)      == (CRef Reference
    r' i
    _)        =  Reference
    rReference -> Reference -> Bool
    forall a. Eq a => a -> a -> Bool
    ==Reference
    r'
        (CMisc Misc
    m i
    _)     == (CMisc Misc
    m' i
    _)       =  Misc
    mMisc -> Misc -> Bool
    forall a. Eq a => a -> a -> Bool
    ==Misc
    m'

    info :: Content t -> t
    info :: forall t. Content t -> t
    info (CElem Element t
    _ t
    i) = t
    i
    info (CString Bool
    _ String
    _ t
    i) = t
    i
    info (CRef Reference
    _ t
    i) = t
    i
    info (CMisc Misc
    _ t
    i) = t
    i

    instance Functor Document where
      fmap :: forall a b. (a -> b) -> Document a -> Document b
    fmap a -> b
    f (Document Prolog
    p SymTab EntityDef
    st Element a
    e [Misc]
    ms) = Prolog -> SymTab EntityDef -> Element b -> [Misc] -> Document b
    forall i.
    Prolog -> SymTab EntityDef -> Element i -> [Misc] -> Document i
    Document Prolog
    p SymTab EntityDef
    st ((a -> b) -> Element a -> Element b
    forall a b. (a -> b) -> Element a -> Element b
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap a -> b
    f Element a
    e) [Misc]
    ms
    instance Functor Element where
      fmap :: forall a b. (a -> b) -> Element a -> Element b
    fmap a -> b
    f (Elem QName
    t [Attribute]
    as [Content a]
    cs) = QName -> [Attribute] -> [Content b] -> Element b
    forall i. QName -> [Attribute] -> [Content i] -> Element i
    Elem QName
    t [Attribute]
    as ((Content a -> Content b) -> [Content a] -> [Content b]
    forall a b. (a -> b) -> [a] -> [b]
    map ((a -> b) -> Content a -> Content b
    forall a b. (a -> b) -> Content a -> Content b
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap a -> b
    f) [Content a]
    cs)
    instance Functor Content where
      fmap :: forall a b. (a -> b) -> Content a -> Content b
    fmap a -> b
    f (CElem Element a
    e a
    i)     = Element b -> b -> Content b
    forall i. Element i -> i -> Content i
    CElem ((a -> b) -> Element a -> Element b
    forall a b. (a -> b) -> Element a -> Element b
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap a -> b
    f Element a
    e) (a -> b
    f a
    i)
      fmap a -> b
    f (CString Bool
    b String
    s a
    i) = Bool -> String -> b -> Content b
    forall i. Bool -> String -> i -> Content i
    CString Bool
    b String
    s (a -> b
    f a
    i)
      fmap a -> b
    f (CRef Reference
    r a
    i)      = Reference -> b -> Content b
    forall i. Reference -> i -> Content i
    CRef Reference
    r (a -> b
    f a
    i)
      fmap a -> b
    f (CMisc Misc
    m a
    i)     = Misc -> b -> Content b
    forall i. Misc -> i -> Content i
    CMisc Misc
    m (a -> b
    f a
    i)

    data ElementDecl = ElementDecl QName ContentSpec deriving (ElementDecl -> ElementDecl -> Bool
    (ElementDecl -> ElementDecl -> Bool)
    -> (ElementDecl -> ElementDecl -> Bool) -> Eq ElementDecl
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: ElementDecl -> ElementDecl -> Bool
    == :: ElementDecl -> ElementDecl -> Bool
    $c/= :: ElementDecl -> ElementDecl -> Bool
    /= :: ElementDecl -> ElementDecl -> Bool
    Eq, Int -> ElementDecl -> ShowS
    [ElementDecl] -> ShowS
    ElementDecl -> String
    (Int -> ElementDecl -> ShowS)
    -> (ElementDecl -> String)
    -> ([ElementDecl] -> ShowS)
    -> Show ElementDecl
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> ElementDecl -> ShowS
    showsPrec :: Int -> ElementDecl -> ShowS
    $cshow :: ElementDecl -> String
    show :: ElementDecl -> String
    $cshowList :: [ElementDecl] -> ShowS
    showList :: [ElementDecl] -> ShowS
    Show)
    data ContentSpec = EMPTY
                     | ANY
                     | Mixed Mixed
                     | ContentSpec CP
                     deriving (ContentSpec -> ContentSpec -> Bool
    (ContentSpec -> ContentSpec -> Bool)
    -> (ContentSpec -> ContentSpec -> Bool) -> Eq ContentSpec
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: ContentSpec -> ContentSpec -> Bool
    == :: ContentSpec -> ContentSpec -> Bool
    $c/= :: ContentSpec -> ContentSpec -> Bool
    /= :: ContentSpec -> ContentSpec -> Bool
    Eq, Int -> ContentSpec -> ShowS
    [ContentSpec] -> ShowS
    ContentSpec -> String
    (Int -> ContentSpec -> ShowS)
    -> (ContentSpec -> String)
    -> ([ContentSpec] -> ShowS)
    -> Show ContentSpec
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> ContentSpec -> ShowS
    showsPrec :: Int -> ContentSpec -> ShowS
    $cshow :: ContentSpec -> String
    show :: ContentSpec -> String
    $cshowList :: [ContentSpec] -> ShowS
    showList :: [ContentSpec] -> ShowS
    Show)
    data CP = TagName QName Modifier
            | Choice [CP] Modifier
            | Seq [CP] Modifier
            deriving (CP -> CP -> Bool
    (CP -> CP -> Bool) -> (CP -> CP -> Bool) -> Eq CP
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: CP -> CP -> Bool
    == :: CP -> CP -> Bool
    $c/= :: CP -> CP -> Bool
    /= :: CP -> CP -> Bool
    Eq, Int -> CP -> ShowS
    [CP] -> ShowS
    CP -> String
    (Int -> CP -> ShowS)
    -> (CP -> String) -> ([CP] -> ShowS) -> Show CP
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> CP -> ShowS
    showsPrec :: Int -> CP -> ShowS
    $cshow :: CP -> String
    show :: CP -> String
    $cshowList :: [CP] -> ShowS
    showList :: [CP] -> ShowS
    Show)
    data Modifier = None  -- ^ Just One
                  | Query -- ^ Zero Or One
                  | Star  -- ^ Zero Or More
                  | Plus  -- ^ One Or More
                  deriving (Modifier -> Modifier -> Bool
    (Modifier -> Modifier -> Bool)
    -> (Modifier -> Modifier -> Bool) -> Eq Modifier
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: Modifier -> Modifier -> Bool
    == :: Modifier -> Modifier -> Bool
    $c/= :: Modifier -> Modifier -> Bool
    /= :: Modifier -> Modifier -> Bool
    Eq, Int -> Modifier -> ShowS
    [Modifier] -> ShowS
    Modifier -> String
    (Int -> Modifier -> ShowS)
    -> (Modifier -> String) -> ([Modifier] -> ShowS) -> Show Modifier
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> Modifier -> ShowS
    showsPrec :: Int -> Modifier -> ShowS
    $cshow :: Modifier -> String
    show :: Modifier -> String
    $cshowList :: [Modifier] -> ShowS
    showList :: [Modifier] -> ShowS
    Show)
    data Mixed = PCDATA
               | PCDATAplus [QName]
               deriving (Mixed -> Mixed -> Bool
    (Mixed -> Mixed -> Bool) -> (Mixed -> Mixed -> Bool) -> Eq Mixed
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: Mixed -> Mixed -> Bool
    == :: Mixed -> Mixed -> Bool
    $c/= :: Mixed -> Mixed -> Bool
    /= :: Mixed -> Mixed -> Bool
    Eq, Int -> Mixed -> ShowS
    [Mixed] -> ShowS
    Mixed -> String
    (Int -> Mixed -> ShowS)
    -> (Mixed -> String) -> ([Mixed] -> ShowS) -> Show Mixed
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> Mixed -> ShowS
    showsPrec :: Int -> Mixed -> ShowS
    $cshow :: Mixed -> String
    show :: Mixed -> String
    $cshowList :: [Mixed] -> ShowS
    showList :: [Mixed] -> ShowS
    Show)
    data AttListDecl = AttListDecl QName [AttDef] deriving (AttListDecl -> AttListDecl -> Bool
    (AttListDecl -> AttListDecl -> Bool)
    -> (AttListDecl -> AttListDecl -> Bool) -> Eq AttListDecl
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: AttListDecl -> AttListDecl -> Bool
    == :: AttListDecl -> AttListDecl -> Bool
    $c/= :: AttListDecl -> AttListDecl -> Bool
    /= :: AttListDecl -> AttListDecl -> Bool
    Eq, Int -> AttListDecl -> ShowS
    [AttListDecl] -> ShowS
    AttListDecl -> String
    (Int -> AttListDecl -> ShowS)
    -> (AttListDecl -> String)
    -> ([AttListDecl] -> ShowS)
    -> Show AttListDecl
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> AttListDecl -> ShowS
    showsPrec :: Int -> AttListDecl -> ShowS
    $cshow :: AttListDecl -> String
    show :: AttListDecl -> String
    $cshowList :: [AttListDecl] -> ShowS
    showList :: [AttListDecl] -> ShowS
    Show)
    data AttDef      = AttDef QName AttType DefaultDecl deriving (AttDef -> AttDef -> Bool
    (AttDef -> AttDef -> Bool)
    -> (AttDef -> AttDef -> Bool) -> Eq AttDef
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: AttDef -> AttDef -> Bool
    == :: AttDef -> AttDef -> Bool
    $c/= :: AttDef -> AttDef -> Bool
    /= :: AttDef -> AttDef -> Bool
    Eq, Int -> AttDef -> ShowS
    [AttDef] -> ShowS
    AttDef -> String
    (Int -> AttDef -> ShowS)
    -> (AttDef -> String) -> ([AttDef] -> ShowS) -> Show AttDef
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> AttDef -> ShowS
    showsPrec :: Int -> AttDef -> ShowS
    $cshow :: AttDef -> String
    show :: AttDef -> String
    $cshowList :: [AttDef] -> ShowS
    showList :: [AttDef] -> ShowS
    Show)
    data AttType     = StringType
                     | TokenizedType TokenizedType
                     | EnumeratedType EnumeratedType
                     deriving (AttType -> AttType -> Bool
    (AttType -> AttType -> Bool)
    -> (AttType -> AttType -> Bool) -> Eq AttType
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: AttType -> AttType -> Bool
    == :: AttType -> AttType -> Bool
    $c/= :: AttType -> AttType -> Bool
    /= :: AttType -> AttType -> Bool
    Eq, Int -> AttType -> ShowS
    [AttType] -> ShowS
    AttType -> String
    (Int -> AttType -> ShowS)
    -> (AttType -> String) -> ([AttType] -> ShowS) -> Show AttType
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> AttType -> ShowS
    showsPrec :: Int -> AttType -> ShowS
    $cshow :: AttType -> String
    show :: AttType -> String
    $cshowList :: [AttType] -> ShowS
    showList :: [AttType] -> ShowS
    Show)
    data TokenizedType = ID
                       | IDREF
                       | IDREFS
                       | ENTITY
                       | ENTITIES
                       | NMTOKEN
                       | NMTOKENS
                       deriving (TokenizedType -> TokenizedType -> Bool
    (TokenizedType -> TokenizedType -> Bool)
    -> (TokenizedType -> TokenizedType -> Bool) -> Eq TokenizedType
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: TokenizedType -> TokenizedType -> Bool
    == :: TokenizedType -> TokenizedType -> Bool
    $c/= :: TokenizedType -> TokenizedType -> Bool
    /= :: TokenizedType -> TokenizedType -> Bool
    Eq, Int -> TokenizedType -> ShowS
    [TokenizedType] -> ShowS
    TokenizedType -> String
    (Int -> TokenizedType -> ShowS)
    -> (TokenizedType -> String)
    -> ([TokenizedType] -> ShowS)
    -> Show TokenizedType
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> TokenizedType -> ShowS
    showsPrec :: Int -> TokenizedType -> ShowS
    $cshow :: TokenizedType -> String
    show :: TokenizedType -> String
    $cshowList :: [TokenizedType] -> ShowS
    showList :: [TokenizedType] -> ShowS
    Show)
    data EnumeratedType = NotationType NotationType
                        | Enumeration Enumeration
                        deriving (EnumeratedType -> EnumeratedType -> Bool
    (EnumeratedType -> EnumeratedType -> Bool)
    -> (EnumeratedType -> EnumeratedType -> Bool) -> Eq EnumeratedType
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: EnumeratedType -> EnumeratedType -> Bool
    == :: EnumeratedType -> EnumeratedType -> Bool
    $c/= :: EnumeratedType -> EnumeratedType -> Bool
    /= :: EnumeratedType -> EnumeratedType -> Bool
    Eq, Int -> EnumeratedType -> ShowS
    [EnumeratedType] -> ShowS
    EnumeratedType -> String
    (Int -> EnumeratedType -> ShowS)
    -> (EnumeratedType -> String)
    -> ([EnumeratedType] -> ShowS)
    -> Show EnumeratedType
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> EnumeratedType -> ShowS
    showsPrec :: Int -> EnumeratedType -> ShowS
    $cshow :: EnumeratedType -> String
    show :: EnumeratedType -> String
    $cshowList :: [EnumeratedType] -> ShowS
    showList :: [EnumeratedType] -> ShowS
    Show)
    type NotationType   = [Name]    -- nonempty list
    type Enumeration    = [NmToken] -- nonempty list
    data DefaultDecl    = REQUIRED
                        | IMPLIED
                        | DefaultTo AttValue (Maybe FIXED)
                        deriving (DefaultDecl -> DefaultDecl -> Bool
    (DefaultDecl -> DefaultDecl -> Bool)
    -> (DefaultDecl -> DefaultDecl -> Bool) -> Eq DefaultDecl
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: DefaultDecl -> DefaultDecl -> Bool
    == :: DefaultDecl -> DefaultDecl -> Bool
    $c/= :: DefaultDecl -> DefaultDecl -> Bool
    /= :: DefaultDecl -> DefaultDecl -> Bool
    Eq, Int -> DefaultDecl -> ShowS
    [DefaultDecl] -> ShowS
    DefaultDecl -> String
    (Int -> DefaultDecl -> ShowS)
    -> (DefaultDecl -> String)
    -> ([DefaultDecl] -> ShowS)
    -> Show DefaultDecl
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> DefaultDecl -> ShowS
    showsPrec :: Int -> DefaultDecl -> ShowS
    $cshow :: DefaultDecl -> String
    show :: DefaultDecl -> String
    $cshowList :: [DefaultDecl] -> ShowS
    showList :: [DefaultDecl] -> ShowS
    Show)
    data FIXED          = FIXED deriving (FIXED -> FIXED -> Bool
    (FIXED -> FIXED -> Bool) -> (FIXED -> FIXED -> Bool) -> Eq FIXED
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: FIXED -> FIXED -> Bool
    == :: FIXED -> FIXED -> Bool
    $c/= :: FIXED -> FIXED -> Bool
    /= :: FIXED -> FIXED -> Bool
    Eq, Int -> FIXED -> ShowS
    [FIXED] -> ShowS
    FIXED -> String
    (Int -> FIXED -> ShowS)
    -> (FIXED -> String) -> ([FIXED] -> ShowS) -> Show FIXED
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> FIXED -> ShowS
    showsPrec :: Int -> FIXED -> ShowS
    $cshow :: FIXED -> String
    show :: FIXED -> String
    $cshowList :: [FIXED] -> ShowS
    showList :: [FIXED] -> ShowS
    Show)

    data ConditionalSect = IncludeSect IncludeSect
                         | IgnoreSect IgnoreSect
                         deriving (ConditionalSect -> ConditionalSect -> Bool
    (ConditionalSect -> ConditionalSect -> Bool)
    -> (ConditionalSect -> ConditionalSect -> Bool)
    -> Eq ConditionalSect
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: ConditionalSect -> ConditionalSect -> Bool
    == :: ConditionalSect -> ConditionalSect -> Bool
    $c/= :: ConditionalSect -> ConditionalSect -> Bool
    /= :: ConditionalSect -> ConditionalSect -> Bool
    Eq, Int -> ConditionalSect -> ShowS
    [ConditionalSect] -> ShowS
    ConditionalSect -> String
    (Int -> ConditionalSect -> ShowS)
    -> (ConditionalSect -> String)
    -> ([ConditionalSect] -> ShowS)
    -> Show ConditionalSect
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> ConditionalSect -> ShowS
    showsPrec :: Int -> ConditionalSect -> ShowS
    $cshow :: ConditionalSect -> String
    show :: ConditionalSect -> String
    $cshowList :: [ConditionalSect] -> ShowS
    showList :: [ConditionalSect] -> ShowS
    Show)
    type IncludeSect = [ExtSubsetDecl]
    type IgnoreSect  = [IgnoreSectContents]
    data Ignore      = Ignore deriving (Ignore -> Ignore -> Bool
    (Ignore -> Ignore -> Bool)
    -> (Ignore -> Ignore -> Bool) -> Eq Ignore
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: Ignore -> Ignore -> Bool
    == :: Ignore -> Ignore -> Bool
    $c/= :: Ignore -> Ignore -> Bool
    /= :: Ignore -> Ignore -> Bool
    Eq, Int -> Ignore -> ShowS
    [Ignore] -> ShowS
    Ignore -> String
    (Int -> Ignore -> ShowS)
    -> (Ignore -> String) -> ([Ignore] -> ShowS) -> Show Ignore
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> Ignore -> ShowS
    showsPrec :: Int -> Ignore -> ShowS
    $cshow :: Ignore -> String
    show :: Ignore -> String
    $cshowList :: [Ignore] -> ShowS
    showList :: [Ignore] -> ShowS
    Show)
    data IgnoreSectContents = IgnoreSectContents Ignore [(IgnoreSectContents,Ignore)]  deriving (IgnoreSectContents -> IgnoreSectContents -> Bool
    (IgnoreSectContents -> IgnoreSectContents -> Bool)
    -> (IgnoreSectContents -> IgnoreSectContents -> Bool)
    -> Eq IgnoreSectContents
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: IgnoreSectContents -> IgnoreSectContents -> Bool
    == :: IgnoreSectContents -> IgnoreSectContents -> Bool
    $c/= :: IgnoreSectContents -> IgnoreSectContents -> Bool
    /= :: IgnoreSectContents -> IgnoreSectContents -> Bool
    Eq, Int -> IgnoreSectContents -> ShowS
    IgnoreSect -> ShowS
    IgnoreSectContents -> String
    (Int -> IgnoreSectContents -> ShowS)
    -> (IgnoreSectContents -> String)
    -> (IgnoreSect -> ShowS)
    -> Show IgnoreSectContents
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> IgnoreSectContents -> ShowS
    showsPrec :: Int -> IgnoreSectContents -> ShowS
    $cshow :: IgnoreSectContents -> String
    show :: IgnoreSectContents -> String
    $cshowList :: IgnoreSect -> ShowS
    showList :: IgnoreSect -> ShowS
    Show)

    data Reference    = RefEntity EntityRef
                      | RefChar CharRef
                      deriving (Reference -> Reference -> Bool
    (Reference -> Reference -> Bool)
    -> (Reference -> Reference -> Bool) -> Eq Reference
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: Reference -> Reference -> Bool
    == :: Reference -> Reference -> Bool
    $c/= :: Reference -> Reference -> Bool
    /= :: Reference -> Reference -> Bool
    Eq,Int -> Reference -> ShowS
    [Reference] -> ShowS
    Reference -> String
    (Int -> Reference -> ShowS)
    -> (Reference -> String)
    -> ([Reference] -> ShowS)
    -> Show Reference
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> Reference -> ShowS
    showsPrec :: Int -> Reference -> ShowS
    $cshow :: Reference -> String
    show :: Reference -> String
    $cshowList :: [Reference] -> ShowS
    showList :: [Reference] -> ShowS
    Show)
    type EntityRef    = Name
    type CharRef      = Int
    type PEReference  = Name

    data EntityDecl   = EntityGEDecl GEDecl
                      | EntityPEDecl PEDecl
                      deriving (EntityDecl -> EntityDecl -> Bool
    (EntityDecl -> EntityDecl -> Bool)
    -> (EntityDecl -> EntityDecl -> Bool) -> Eq EntityDecl
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: EntityDecl -> EntityDecl -> Bool
    == :: EntityDecl -> EntityDecl -> Bool
    $c/= :: EntityDecl -> EntityDecl -> Bool
    /= :: EntityDecl -> EntityDecl -> Bool
    Eq, Int -> EntityDecl -> ShowS
    [EntityDecl] -> ShowS
    EntityDecl -> String
    (Int -> EntityDecl -> ShowS)
    -> (EntityDecl -> String)
    -> ([EntityDecl] -> ShowS)
    -> Show EntityDecl
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> EntityDecl -> ShowS
    showsPrec :: Int -> EntityDecl -> ShowS
    $cshow :: EntityDecl -> String
    show :: EntityDecl -> String
    $cshowList :: [EntityDecl] -> ShowS
    showList :: [EntityDecl] -> ShowS
    Show)
    data GEDecl       = GEDecl Name EntityDef deriving (GEDecl -> GEDecl -> Bool
    (GEDecl -> GEDecl -> Bool)
    -> (GEDecl -> GEDecl -> Bool) -> Eq GEDecl
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: GEDecl -> GEDecl -> Bool
    == :: GEDecl -> GEDecl -> Bool
    $c/= :: GEDecl -> GEDecl -> Bool
    /= :: GEDecl -> GEDecl -> Bool
    Eq, Int -> GEDecl -> ShowS
    [GEDecl] -> ShowS
    GEDecl -> String
    (Int -> GEDecl -> ShowS)
    -> (GEDecl -> String) -> ([GEDecl] -> ShowS) -> Show GEDecl
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> GEDecl -> ShowS
    showsPrec :: Int -> GEDecl -> ShowS
    $cshow :: GEDecl -> String
    show :: GEDecl -> String
    $cshowList :: [GEDecl] -> ShowS
    showList :: [GEDecl] -> ShowS
    Show)
    data PEDecl       = PEDecl Name PEDef deriving (PEDecl -> PEDecl -> Bool
    (PEDecl -> PEDecl -> Bool)
    -> (PEDecl -> PEDecl -> Bool) -> Eq PEDecl
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: PEDecl -> PEDecl -> Bool
    == :: PEDecl -> PEDecl -> Bool
    $c/= :: PEDecl -> PEDecl -> Bool
    /= :: PEDecl -> PEDecl -> Bool
    Eq, Int -> PEDecl -> ShowS
    [PEDecl] -> ShowS
    PEDecl -> String
    (Int -> PEDecl -> ShowS)
    -> (PEDecl -> String) -> ([PEDecl] -> ShowS) -> Show PEDecl
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> PEDecl -> ShowS
    showsPrec :: Int -> PEDecl -> ShowS
    $cshow :: PEDecl -> String
    show :: PEDecl -> String
    $cshowList :: [PEDecl] -> ShowS
    showList :: [PEDecl] -> ShowS
    Show)
    data EntityDef    = DefEntityValue EntityValue
                      | DefExternalID ExternalID (Maybe NDataDecl)
                      deriving (EntityDef -> EntityDef -> Bool
    (EntityDef -> EntityDef -> Bool)
    -> (EntityDef -> EntityDef -> Bool) -> Eq EntityDef
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: EntityDef -> EntityDef -> Bool
    == :: EntityDef -> EntityDef -> Bool
    $c/= :: EntityDef -> EntityDef -> Bool
    /= :: EntityDef -> EntityDef -> Bool
    Eq, Int -> EntityDef -> ShowS
    [EntityDef] -> ShowS
    EntityDef -> String
    (Int -> EntityDef -> ShowS)
    -> (EntityDef -> String)
    -> ([EntityDef] -> ShowS)
    -> Show EntityDef
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> EntityDef -> ShowS
    showsPrec :: Int -> EntityDef -> ShowS
    $cshow :: EntityDef -> String
    show :: EntityDef -> String
    $cshowList :: [EntityDef] -> ShowS
    showList :: [EntityDef] -> ShowS
    Show)
    data PEDef        = PEDefEntityValue EntityValue
                      | PEDefExternalID ExternalID deriving (PEDef -> PEDef -> Bool
    (PEDef -> PEDef -> Bool) -> (PEDef -> PEDef -> Bool) -> Eq PEDef
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: PEDef -> PEDef -> Bool
    == :: PEDef -> PEDef -> Bool
    $c/= :: PEDef -> PEDef -> Bool
    /= :: PEDef -> PEDef -> Bool
    Eq,Int -> PEDef -> ShowS
    [PEDef] -> ShowS
    PEDef -> String
    (Int -> PEDef -> ShowS)
    -> (PEDef -> String) -> ([PEDef] -> ShowS) -> Show PEDef
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> PEDef -> ShowS
    showsPrec :: Int -> PEDef -> ShowS
    $cshow :: PEDef -> String
    show :: PEDef -> String
    $cshowList :: [PEDef] -> ShowS
    showList :: [PEDef] -> ShowS
    Show)
    data ExternalID   = SYSTEM SystemLiteral
                      | PUBLIC PubidLiteral SystemLiteral deriving (ExternalID -> ExternalID -> Bool
    (ExternalID -> ExternalID -> Bool)
    -> (ExternalID -> ExternalID -> Bool) -> Eq ExternalID
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: ExternalID -> ExternalID -> Bool
    == :: ExternalID -> ExternalID -> Bool
    $c/= :: ExternalID -> ExternalID -> Bool
    /= :: ExternalID -> ExternalID -> Bool
    Eq,Int -> ExternalID -> ShowS
    [ExternalID] -> ShowS
    ExternalID -> String
    (Int -> ExternalID -> ShowS)
    -> (ExternalID -> String)
    -> ([ExternalID] -> ShowS)
    -> Show ExternalID
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> ExternalID -> ShowS
    showsPrec :: Int -> ExternalID -> ShowS
    $cshow :: ExternalID -> String
    show :: ExternalID -> String
    $cshowList :: [ExternalID] -> ShowS
    showList :: [ExternalID] -> ShowS
    Show)
    newtype NDataDecl = NDATA Name  deriving (NDataDecl -> NDataDecl -> Bool
    (NDataDecl -> NDataDecl -> Bool)
    -> (NDataDecl -> NDataDecl -> Bool) -> Eq NDataDecl
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: NDataDecl -> NDataDecl -> Bool
    == :: NDataDecl -> NDataDecl -> Bool
    $c/= :: NDataDecl -> NDataDecl -> Bool
    /= :: NDataDecl -> NDataDecl -> Bool
    Eq, Int -> NDataDecl -> ShowS
    [NDataDecl] -> ShowS
    NDataDecl -> String
    (Int -> NDataDecl -> ShowS)
    -> (NDataDecl -> String)
    -> ([NDataDecl] -> ShowS)
    -> Show NDataDecl
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> NDataDecl -> ShowS
    showsPrec :: Int -> NDataDecl -> ShowS
    $cshow :: NDataDecl -> String
    show :: NDataDecl -> String
    $cshowList :: [NDataDecl] -> ShowS
    showList :: [NDataDecl] -> ShowS
    Show)

    data TextDecl       = TextDecl (Maybe VersionInfo) EncodingDecl  deriving (TextDecl -> TextDecl -> Bool
    (TextDecl -> TextDecl -> Bool)
    -> (TextDecl -> TextDecl -> Bool) -> Eq TextDecl
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: TextDecl -> TextDecl -> Bool
    == :: TextDecl -> TextDecl -> Bool
    $c/= :: TextDecl -> TextDecl -> Bool
    /= :: TextDecl -> TextDecl -> Bool
    Eq, Int -> TextDecl -> ShowS
    [TextDecl] -> ShowS
    TextDecl -> String
    (Int -> TextDecl -> ShowS)
    -> (TextDecl -> String) -> ([TextDecl] -> ShowS) -> Show TextDecl
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> TextDecl -> ShowS
    showsPrec :: Int -> TextDecl -> ShowS
    $cshow :: TextDecl -> String
    show :: TextDecl -> String
    $cshowList :: [TextDecl] -> ShowS
    showList :: [TextDecl] -> ShowS
    Show)
    data ExtParsedEnt i = ExtParsedEnt (Maybe TextDecl) (Content i) deriving (ExtParsedEnt i -> ExtParsedEnt i -> Bool
    (ExtParsedEnt i -> ExtParsedEnt i -> Bool)
    -> (ExtParsedEnt i -> ExtParsedEnt i -> Bool)
    -> Eq (ExtParsedEnt i)
    forall i. ExtParsedEnt i -> ExtParsedEnt i -> Bool
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: forall i. ExtParsedEnt i -> ExtParsedEnt i -> Bool
    == :: ExtParsedEnt i -> ExtParsedEnt i -> Bool
    $c/= :: forall i. ExtParsedEnt i -> ExtParsedEnt i -> Bool
    /= :: ExtParsedEnt i -> ExtParsedEnt i -> Bool
    Eq, Int -> ExtParsedEnt i -> ShowS
    [ExtParsedEnt i] -> ShowS
    ExtParsedEnt i -> String
    (Int -> ExtParsedEnt i -> ShowS)
    -> (ExtParsedEnt i -> String)
    -> ([ExtParsedEnt i] -> ShowS)
    -> Show (ExtParsedEnt i)
    forall i. Show i => Int -> ExtParsedEnt i -> ShowS
    forall i. Show i => [ExtParsedEnt i] -> ShowS
    forall i. Show i => ExtParsedEnt i -> String
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: forall i. Show i => Int -> ExtParsedEnt i -> ShowS
    showsPrec :: Int -> ExtParsedEnt i -> ShowS
    $cshow :: forall i. Show i => ExtParsedEnt i -> String
    show :: ExtParsedEnt i -> String
    $cshowList :: forall i. Show i => [ExtParsedEnt i] -> ShowS
    showList :: [ExtParsedEnt i] -> ShowS
    Show)
    data ExtPE          = ExtPE (Maybe TextDecl) [ExtSubsetDecl] deriving (ExtPE -> ExtPE -> Bool
    (ExtPE -> ExtPE -> Bool) -> (ExtPE -> ExtPE -> Bool) -> Eq ExtPE
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: ExtPE -> ExtPE -> Bool
    == :: ExtPE -> ExtPE -> Bool
    $c/= :: ExtPE -> ExtPE -> Bool
    /= :: ExtPE -> ExtPE -> Bool
    Eq, Int -> ExtPE -> ShowS
    [ExtPE] -> ShowS
    ExtPE -> String
    (Int -> ExtPE -> ShowS)
    -> (ExtPE -> String) -> ([ExtPE] -> ShowS) -> Show ExtPE
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> ExtPE -> ShowS
    showsPrec :: Int -> ExtPE -> ShowS
    $cshow :: ExtPE -> String
    show :: ExtPE -> String
    $cshowList :: [ExtPE] -> ShowS
    showList :: [ExtPE] -> ShowS
    Show)

    data NotationDecl    = NOTATION Name (Either ExternalID PublicID) deriving (NotationDecl -> NotationDecl -> Bool
    (NotationDecl -> NotationDecl -> Bool)
    -> (NotationDecl -> NotationDecl -> Bool) -> Eq NotationDecl
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: NotationDecl -> NotationDecl -> Bool
    == :: NotationDecl -> NotationDecl -> Bool
    $c/= :: NotationDecl -> NotationDecl -> Bool
    /= :: NotationDecl -> NotationDecl -> Bool
    Eq, Int -> NotationDecl -> ShowS
    [NotationDecl] -> ShowS
    NotationDecl -> String
    (Int -> NotationDecl -> ShowS)
    -> (NotationDecl -> String)
    -> ([NotationDecl] -> ShowS)
    -> Show NotationDecl
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> NotationDecl -> ShowS
    showsPrec :: Int -> NotationDecl -> ShowS
    $cshow :: NotationDecl -> String
    show :: NotationDecl -> String
    $cshowList :: [NotationDecl] -> ShowS
    showList :: [NotationDecl] -> ShowS
    Show)
    newtype PublicID     = PUBLICID PubidLiteral deriving (PublicID -> PublicID -> Bool
    (PublicID -> PublicID -> Bool)
    -> (PublicID -> PublicID -> Bool) -> Eq PublicID
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: PublicID -> PublicID -> Bool
    == :: PublicID -> PublicID -> Bool
    $c/= :: PublicID -> PublicID -> Bool
    /= :: PublicID -> PublicID -> Bool
    Eq, Int -> PublicID -> ShowS
    [PublicID] -> ShowS
    PublicID -> String
    (Int -> PublicID -> ShowS)
    -> (PublicID -> String) -> ([PublicID] -> ShowS) -> Show PublicID
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> PublicID -> ShowS
    showsPrec :: Int -> PublicID -> ShowS
    $cshow :: PublicID -> String
    show :: PublicID -> String
    $cshowList :: [PublicID] -> ShowS
    showList :: [PublicID] -> ShowS
    Show)
    newtype EncodingDecl = EncodingDecl String deriving (EncodingDecl -> EncodingDecl -> Bool
    (EncodingDecl -> EncodingDecl -> Bool)
    -> (EncodingDecl -> EncodingDecl -> Bool) -> Eq EncodingDecl
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: EncodingDecl -> EncodingDecl -> Bool
    == :: EncodingDecl -> EncodingDecl -> Bool
    $c/= :: EncodingDecl -> EncodingDecl -> Bool
    /= :: EncodingDecl -> EncodingDecl -> Bool
    Eq, Int -> EncodingDecl -> ShowS
    [EncodingDecl] -> ShowS
    EncodingDecl -> String
    (Int -> EncodingDecl -> ShowS)
    -> (EncodingDecl -> String)
    -> ([EncodingDecl] -> ShowS)
    -> Show EncodingDecl
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> EncodingDecl -> ShowS
    showsPrec :: Int -> EncodingDecl -> ShowS
    $cshow :: EncodingDecl -> String
    show :: EncodingDecl -> String
    $cshowList :: [EncodingDecl] -> ShowS
    showList :: [EncodingDecl] -> ShowS
    Show)

    -- | A QName is a (possibly) qualified name, in the sense of XML namespaces.
    data QName    = N  Name
                  | QN Namespace Name deriving (QName -> QName -> Bool
    (QName -> QName -> Bool) -> (QName -> QName -> Bool) -> Eq QName
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: QName -> QName -> Bool
    == :: QName -> QName -> Bool
    $c/= :: QName -> QName -> Bool
    /= :: QName -> QName -> Bool
    Eq,Int -> QName -> ShowS
    [QName] -> ShowS
    QName -> String
    (Int -> QName -> ShowS)
    -> (QName -> String) -> ([QName] -> ShowS) -> Show QName
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> QName -> ShowS
    showsPrec :: Int -> QName -> ShowS
    $cshow :: QName -> String
    show :: QName -> String
    $cshowList :: [QName] -> ShowS
    showList :: [QName] -> ShowS
    Show)
    -- | Namespaces are not defined in the XML spec itself, but at
    --       http://www.w3.org/TR/xml-names
    data Namespace = Namespace { Namespace -> String
    nsPrefix  :: String
                               , Namespace -> String
    nsURI     :: String
                               }
                     deriving (Int -> Namespace -> ShowS
    [Namespace] -> ShowS
    Namespace -> String
    (Int -> Namespace -> ShowS)
    -> (Namespace -> String)
    -> ([Namespace] -> ShowS)
    -> Show Namespace
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> Namespace -> ShowS
    showsPrec :: Int -> Namespace -> ShowS
    $cshow :: Namespace -> String
    show :: Namespace -> String
    $cshowList :: [Namespace] -> ShowS
    showList :: [Namespace] -> ShowS
    Show)
    instance Eq Namespace where
        Namespace
    p == :: Namespace -> Namespace -> Bool
    == Namespace
    q  =  Namespace -> String
    nsURI Namespace
    p String -> String -> Bool
    forall a. Eq a => a -> a -> Bool
    == Namespace -> String
    nsURI Namespace
    q     -- this is the W3C spec's definition!
    instance Ord QName where
        compare :: QName -> QName -> Ordering
    compare (N String
    n)    (N String
    m)    = String -> String -> Ordering
    forall a. Ord a => a -> a -> Ordering
    compare String
    n String
    m
        compare (QN Namespace
    p String
    n) (N String
    m)    = Ordering
    LT
        compare (N String
    n)    (QN Namespace
    q String
    m) = Ordering
    GT
        compare (QN Namespace
    p String
    n) (QN Namespace
    q String
    m) = case String -> String -> Ordering
    forall a. Ord a => a -> a -> Ordering
    compare (Namespace -> String
    nsPrefix Namespace
    p) (Namespace -> String
    nsPrefix Namespace
    q) of
                                      Ordering
    EQ -> String -> String -> Ordering
    forall a. Ord a => a -> a -> Ordering
    compare String
    n String
    m
                                      Ordering
    r  -> Ordering
    r

    type Name     = String           -- non-empty string
    type Names    = [Name]           -- non-empty list
    type NmToken  = String           -- non-empty string
    type NmTokens = [NmToken]        -- non-empty list

    data AttValue    = AttValue [Either String Reference] deriving AttValue -> AttValue -> Bool
    (AttValue -> AttValue -> Bool)
    -> (AttValue -> AttValue -> Bool) -> Eq AttValue
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: AttValue -> AttValue -> Bool
    == :: AttValue -> AttValue -> Bool
    $c/= :: AttValue -> AttValue -> Bool
    /= :: AttValue -> AttValue -> Bool
    Eq
    instance Show AttValue where
      show :: AttValue -> String
    show (AttValue [Either String Reference]
    v) = (Either String Reference -> String)
    -> [Either String Reference] -> String
    forall (t :: * -> *) a b. Foldable t => (a -> [b]) -> t a -> [b]
    concatMap Either String Reference -> String
    decode [Either String Reference]
    v
        where
          decode :: Either String Reference -> String
    decode (Left  String
    w)               = String
    w
          decode (Right (RefEntity String
    ent)) = String
    "&"String -> ShowS
    forall a. [a] -> [a] -> [a]
    ++String
    entString -> ShowS
    forall a. [a] -> [a] -> [a]
    ++String
    ";"
          decode (Right (RefChar Int
    cref))  = String
    "&"String -> ShowS
    forall a. [a] -> [a] -> [a]
    ++Int -> String
    forall a. Show a => a -> String
    show Int
    crefString -> ShowS
    forall a. [a] -> [a] -> [a]
    ++String
    ";"

    data EntityValue = EntityValue [EV] deriving (EntityValue -> EntityValue -> Bool
    (EntityValue -> EntityValue -> Bool)
    -> (EntityValue -> EntityValue -> Bool) -> Eq EntityValue
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: EntityValue -> EntityValue -> Bool
    == :: EntityValue -> EntityValue -> Bool
    $c/= :: EntityValue -> EntityValue -> Bool
    /= :: EntityValue -> EntityValue -> Bool
    Eq,Int -> EntityValue -> ShowS
    [EntityValue] -> ShowS
    EntityValue -> String
    (Int -> EntityValue -> ShowS)
    -> (EntityValue -> String)
    -> ([EntityValue] -> ShowS)
    -> Show EntityValue
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> EntityValue -> ShowS
    showsPrec :: Int -> EntityValue -> ShowS
    $cshow :: EntityValue -> String
    show :: EntityValue -> String
    $cshowList :: [EntityValue] -> ShowS
    showList :: [EntityValue] -> ShowS
    Show)
    data EV = EVString String
     --  -- | EVPERef PEReference
            | EVRef Reference  deriving (EV -> EV -> Bool
    (EV -> EV -> Bool) -> (EV -> EV -> Bool) -> Eq EV
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: EV -> EV -> Bool
    == :: EV -> EV -> Bool
    $c/= :: EV -> EV -> Bool
    /= :: EV -> EV -> Bool
    Eq,Int -> EV -> ShowS
    [EV] -> ShowS
    EV -> String
    (Int -> EV -> ShowS)
    -> (EV -> String) -> ([EV] -> ShowS) -> Show EV
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> EV -> ShowS
    showsPrec :: Int -> EV -> ShowS
    $cshow :: EV -> String
    show :: EV -> String
    $cshowList :: [EV] -> ShowS
    showList :: [EV] -> ShowS
    Show)
    newtype PubidLiteral  = PubidLiteral String deriving (PubidLiteral -> PubidLiteral -> Bool
    (PubidLiteral -> PubidLiteral -> Bool)
    -> (PubidLiteral -> PubidLiteral -> Bool) -> Eq PubidLiteral
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: PubidLiteral -> PubidLiteral -> Bool
    == :: PubidLiteral -> PubidLiteral -> Bool
    $c/= :: PubidLiteral -> PubidLiteral -> Bool
    /= :: PubidLiteral -> PubidLiteral -> Bool
    Eq,Int -> PubidLiteral -> ShowS
    [PubidLiteral] -> ShowS
    PubidLiteral -> String
    (Int -> PubidLiteral -> ShowS)
    -> (PubidLiteral -> String)
    -> ([PubidLiteral] -> ShowS)
    -> Show PubidLiteral
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> PubidLiteral -> ShowS
    showsPrec :: Int -> PubidLiteral -> ShowS
    $cshow :: PubidLiteral -> String
    show :: PubidLiteral -> String
    $cshowList :: [PubidLiteral] -> ShowS
    showList :: [PubidLiteral] -> ShowS
    Show)
    newtype SystemLiteral = SystemLiteral String deriving (SystemLiteral -> SystemLiteral -> Bool
    (SystemLiteral -> SystemLiteral -> Bool)
    -> (SystemLiteral -> SystemLiteral -> Bool) -> Eq SystemLiteral
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: SystemLiteral -> SystemLiteral -> Bool
    == :: SystemLiteral -> SystemLiteral -> Bool
    $c/= :: SystemLiteral -> SystemLiteral -> Bool
    /= :: SystemLiteral -> SystemLiteral -> Bool
    Eq,Int -> SystemLiteral -> ShowS
    [SystemLiteral] -> ShowS
    SystemLiteral -> String
    (Int -> SystemLiteral -> ShowS)
    -> (SystemLiteral -> String)
    -> ([SystemLiteral] -> ShowS)
    -> Show SystemLiteral
    forall a.
    (Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
    $cshowsPrec :: Int -> SystemLiteral -> ShowS
    showsPrec :: Int -> SystemLiteral -> ShowS
    $cshow :: SystemLiteral -> String
    show :: SystemLiteral -> String
    $cshowList :: [SystemLiteral] -> ShowS
    showList :: [SystemLiteral] -> ShowS
    Show)
    type CharData         = String
    type CDSect           = CharData

    instance Eq ElemTag where
        (ElemTag QName
    n [Attribute]
    _) == :: ElemTag -> ElemTag -> Bool
    == (ElemTag QName
    m [Attribute]
    _)  = QName
    nQName -> QName -> Bool
    forall a. Eq a => a -> a -> Bool
    ==QName
    m