HaXml-1.25.5: Utilities for manipulating XML documents

Safe HaskellSafe
LanguageHaskell98

Text.XML.HaXml.Types

Contents

Description

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.

Synopsis

A simple symbol table mapping strings (references) to values.

type SymTab a = [(String, a)] #

Symbol table operations

addST :: String -> a -> SymTab a -> SymTab a #

XML Types

The top-level document container

data Document i #

The symbol table stored in a document holds all its general entity reference definitions.

Constructors

Document Prolog (SymTab EntityDef) (Element i) [Misc] 
Instances
Functor Document # 
Instance details

Defined in Text.XML.HaXml.Types

Methods

fmap :: (a -> b) -> Document a -> Document b #

(<$) :: a -> Document b -> Document a #

Eq (Document i) # 
Instance details

Defined in Text.XML.HaXml.Types

Methods

(==) :: Document i -> Document i -> Bool #

(/=) :: Document i -> Document i -> Bool #

Show i => Show (Document i) # 
Instance details

Defined in Text.XML.HaXml.Types

Methods

showsPrec :: Int -> Document i -> ShowS #

show :: Document i -> String #

showList :: [Document i] -> ShowS #

The main document content

data Element i #

Constructors

Elem QName [Attribute] [Content i] 
Instances
Functor Element # 
Instance details

Defined in Text.XML.HaXml.Types

Methods

fmap :: (a -> b) -> Element a -> Element b #

(<$) :: a -> Element b -> Element a #

Eq (Element i) # 
Instance details

Defined in Text.XML.HaXml.Types

Methods

(==) :: Element i -> Element i -> Bool #

(/=) :: Element i -> Element i -> Bool #

Show i => Show (Element i) # 
Instance details

Defined in Text.XML.HaXml.Types

Methods

showsPrec :: Int -> Element i -> ShowS #

show :: Element i -> String #

showList :: [Element i] -> ShowS #

Verbatim (Element i) # 
Instance details

Defined in Text.XML.HaXml.Verbatim

Methods

verbatim :: Element i -> String #

data ElemTag #

Constructors

ElemTag QName [Attribute] 
Instances
Eq ElemTag # 
Instance details

Defined in Text.XML.HaXml.Types

Methods

(==) :: ElemTag -> ElemTag -> Bool #

(/=) :: ElemTag -> ElemTag -> Bool #

data Content i #

Constructors

CElem (Element i) i 
CString Bool CharData i

bool is whether whitespace is significant

CRef Reference i 
CMisc Misc i 
Instances
Functor Content # 
Instance details

Defined in Text.XML.HaXml.Types

Methods

fmap :: (a -> b) -> Content a -> Content b #

(<$) :: a -> Content b -> Content a #

Eq (Content i) # 
Instance details

Defined in Text.XML.HaXml.Types

Methods

(==) :: Content i -> Content i -> Bool #

(/=) :: Content i -> Content i -> Bool #

Show i => Show (Content i) # 
Instance details

Defined in Text.XML.HaXml.Types

Methods

showsPrec :: Int -> Content i -> ShowS #

show :: Content i -> String #

showList :: [Content i] -> ShowS #

Verbatim (Content i) # 
Instance details

Defined in Text.XML.HaXml.Verbatim

Methods

verbatim :: Content i -> String #

data AttValue #

Instances
Eq AttValue # 
Instance details

Defined in Text.XML.HaXml.Types

Show AttValue # 
Instance details

Defined in Text.XML.HaXml.Types

Verbatim AttValue # 
Instance details

Defined in Text.XML.HaXml.Verbatim

Methods

verbatim :: AttValue -> String #

info :: Content t -> t #

Administrative parts of the document

data Prolog #

Constructors

Prolog (Maybe XMLDecl) [Misc] (Maybe DocTypeDecl) [Misc] 
Instances
Eq Prolog # 
Instance details

Defined in Text.XML.HaXml.Types

Methods

(==) :: Prolog -> Prolog -> Bool #

(/=) :: Prolog -> Prolog -> Bool #

Show Prolog # 
Instance details

Defined in Text.XML.HaXml.Types

data XMLDecl #

Instances
Eq XMLDecl # 
Instance details

Defined in Text.XML.HaXml.Types

Methods

(==) :: XMLDecl -> XMLDecl -> Bool #

(/=) :: XMLDecl -> XMLDecl -> Bool #

Show XMLDecl # 
Instance details

Defined in Text.XML.HaXml.Types

data Misc #

Instances
Eq Misc # 
Instance details

Defined in Text.XML.HaXml.Types

Methods

(==) :: Misc -> Misc -> Bool #

(/=) :: Misc -> Misc -> Bool #

Show Misc # 
Instance details

Defined in Text.XML.HaXml.Types

Methods

showsPrec :: Int -> Misc -> ShowS #

show :: Misc -> String #

showList :: [Misc] -> ShowS #

type SDDecl = Bool #

The DTD

content model

data DocTypeDecl #

Constructors

DTD QName (Maybe ExternalID) [MarkupDecl] 
Instances
Eq DocTypeDecl # 
Instance details

Defined in Text.XML.HaXml.Types

Show DocTypeDecl # 
Instance details

Defined in Text.XML.HaXml.Types

data ExtSubset #

Instances
Eq ExtSubset # 
Instance details

Defined in Text.XML.HaXml.Types

Show ExtSubset # 
Instance details

Defined in Text.XML.HaXml.Types

data ElementDecl #

Instances
Eq ElementDecl # 
Instance details

Defined in Text.XML.HaXml.Types

Show ElementDecl # 
Instance details

Defined in Text.XML.HaXml.Types

data ContentSpec #

Constructors

EMPTY 
ANY 
Mixed Mixed 
ContentSpec CP 
Instances
Eq ContentSpec # 
Instance details

Defined in Text.XML.HaXml.Types

Show ContentSpec # 
Instance details

Defined in Text.XML.HaXml.Types

data CP #

Instances
Eq CP # 
Instance details

Defined in Text.XML.HaXml.Types

Methods

(==) :: CP -> CP -> Bool #

(/=) :: CP -> CP -> Bool #

Show CP # 
Instance details

Defined in Text.XML.HaXml.Types

Methods

showsPrec :: Int -> CP -> ShowS #

show :: CP -> String #

showList :: [CP] -> ShowS #

data Modifier #

Constructors

None

Just One

Query

Zero Or One

Star

Zero Or More

Plus

One Or More

Instances
Eq Modifier # 
Instance details

Defined in Text.XML.HaXml.Types

Show Modifier # 
Instance details

Defined in Text.XML.HaXml.Types

data Mixed #

Constructors

PCDATA 
PCDATAplus [QName] 
Instances
Eq Mixed # 
Instance details

Defined in Text.XML.HaXml.Types

Methods

(==) :: Mixed -> Mixed -> Bool #

(/=) :: Mixed -> Mixed -> Bool #

Show Mixed # 
Instance details

Defined in Text.XML.HaXml.Types

Methods

showsPrec :: Int -> Mixed -> ShowS #

show :: Mixed -> String #

showList :: [Mixed] -> ShowS #

attribute model

data AttListDecl #

Constructors

AttListDecl QName [AttDef] 
Instances
Eq AttListDecl # 
Instance details

Defined in Text.XML.HaXml.Types

Show AttListDecl # 
Instance details

Defined in Text.XML.HaXml.Types

data AttDef #

Instances
Eq AttDef # 
Instance details

Defined in Text.XML.HaXml.Types

Methods

(==) :: AttDef -> AttDef -> Bool #

(/=) :: AttDef -> AttDef -> Bool #

Show AttDef # 
Instance details

Defined in Text.XML.HaXml.Types

data AttType #

Instances
Eq AttType # 
Instance details

Defined in Text.XML.HaXml.Types

Methods

(==) :: AttType -> AttType -> Bool #

(/=) :: AttType -> AttType -> Bool #

Show AttType # 
Instance details

Defined in Text.XML.HaXml.Types

data DefaultDecl #

Instances
Eq DefaultDecl # 
Instance details

Defined in Text.XML.HaXml.Types

Show DefaultDecl # 
Instance details

Defined in Text.XML.HaXml.Types

data FIXED #

Constructors

FIXED 
Instances
Eq FIXED # 
Instance details

Defined in Text.XML.HaXml.Types

Methods

(==) :: FIXED -> FIXED -> Bool #

(/=) :: FIXED -> FIXED -> Bool #

Show FIXED # 
Instance details

Defined in Text.XML.HaXml.Types

Methods

showsPrec :: Int -> FIXED -> ShowS #

show :: FIXED -> String #

showList :: [FIXED] -> ShowS #

conditional sections

data Ignore #

Constructors

Ignore 
Instances
Eq Ignore # 
Instance details

Defined in Text.XML.HaXml.Types

Methods

(==) :: Ignore -> Ignore -> Bool #

(/=) :: Ignore -> Ignore -> Bool #

Show Ignore # 
Instance details

Defined in Text.XML.HaXml.Types

References

data Reference #

Instances
Eq Reference # 
Instance details

Defined in Text.XML.HaXml.Types

Show Reference # 
Instance details

Defined in Text.XML.HaXml.Types

Verbatim Reference # 
Instance details

Defined in Text.XML.HaXml.Verbatim

Methods

verbatim :: Reference -> String #

type CharRef = Int #

Entities

data EntityDecl #

Instances
Eq EntityDecl # 
Instance details

Defined in Text.XML.HaXml.Types

Show EntityDecl # 
Instance details

Defined in Text.XML.HaXml.Types

data GEDecl #

Constructors

GEDecl Name EntityDef 
Instances
Eq GEDecl # 
Instance details

Defined in Text.XML.HaXml.Types

Methods

(==) :: GEDecl -> GEDecl -> Bool #

(/=) :: GEDecl -> GEDecl -> Bool #

Show GEDecl # 
Instance details

Defined in Text.XML.HaXml.Types

data PEDecl #

Constructors

PEDecl Name PEDef 
Instances
Eq PEDecl # 
Instance details

Defined in Text.XML.HaXml.Types

Methods

(==) :: PEDecl -> PEDecl -> Bool #

(/=) :: PEDecl -> PEDecl -> Bool #

Show PEDecl # 
Instance details

Defined in Text.XML.HaXml.Types

data EntityDef #

Instances
Eq EntityDef # 
Instance details

Defined in Text.XML.HaXml.Types

Show EntityDef # 
Instance details

Defined in Text.XML.HaXml.Types

data PEDef #

Instances
Eq PEDef # 
Instance details

Defined in Text.XML.HaXml.Types

Methods

(==) :: PEDef -> PEDef -> Bool #

(/=) :: PEDef -> PEDef -> Bool #

Show PEDef # 
Instance details

Defined in Text.XML.HaXml.Types

Methods

showsPrec :: Int -> PEDef -> ShowS #

show :: PEDef -> String #

showList :: [PEDef] -> ShowS #

newtype NDataDecl #

Constructors

NDATA Name 
Instances
Eq NDataDecl # 
Instance details

Defined in Text.XML.HaXml.Types

Show NDataDecl # 
Instance details

Defined in Text.XML.HaXml.Types

data TextDecl #

Instances
Eq TextDecl # 
Instance details

Defined in Text.XML.HaXml.Types

Show TextDecl # 
Instance details

Defined in Text.XML.HaXml.Types

data ExtParsedEnt i #

Constructors

ExtParsedEnt (Maybe TextDecl) (Content i) 
Instances
Eq (ExtParsedEnt i) # 
Instance details

Defined in Text.XML.HaXml.Types

Show i => Show (ExtParsedEnt i) # 
Instance details

Defined in Text.XML.HaXml.Types

data ExtPE #

Constructors

ExtPE (Maybe TextDecl) [ExtSubsetDecl] 
Instances
Eq ExtPE # 
Instance details

Defined in Text.XML.HaXml.Types

Methods

(==) :: ExtPE -> ExtPE -> Bool #

(/=) :: ExtPE -> ExtPE -> Bool #

Show ExtPE # 
Instance details

Defined in Text.XML.HaXml.Types

Methods

showsPrec :: Int -> ExtPE -> ShowS #

show :: ExtPE -> String #

showList :: [ExtPE] -> ShowS #

newtype PublicID #

Constructors

PUBLICID PubidLiteral 
Instances
Eq PublicID # 
Instance details

Defined in Text.XML.HaXml.Types

Show PublicID # 
Instance details

Defined in Text.XML.HaXml.Types

newtype EncodingDecl #

Constructors

EncodingDecl String 
Instances
Eq EncodingDecl # 
Instance details

Defined in Text.XML.HaXml.Types

Show EncodingDecl # 
Instance details

Defined in Text.XML.HaXml.Types

data EntityValue #

Constructors

EntityValue [EV] 
Instances
Eq EntityValue # 
Instance details

Defined in Text.XML.HaXml.Types

Show EntityValue # 
Instance details

Defined in Text.XML.HaXml.Types

data EV #

Instances
Eq EV # 
Instance details

Defined in Text.XML.HaXml.Types

Methods

(==) :: EV -> EV -> Bool #

(/=) :: EV -> EV -> Bool #

Show EV # 
Instance details

Defined in Text.XML.HaXml.Types

Methods

showsPrec :: Int -> EV -> ShowS #

show :: EV -> String #

showList :: [EV] -> ShowS #

newtype PubidLiteral #

Constructors

PubidLiteral String 
Instances
Eq PubidLiteral # 
Instance details

Defined in Text.XML.HaXml.Types

Show PubidLiteral # 
Instance details

Defined in Text.XML.HaXml.Types

Namespaces

data QName #

A QName is a (possibly) qualified name, in the sense of XML namespaces.

Constructors

N Name 
QN Namespace Name 
Instances
Eq QName # 
Instance details

Defined in Text.XML.HaXml.Types

Methods

(==) :: QName -> QName -> Bool #

(/=) :: QName -> QName -> Bool #

Ord QName # 
Instance details

Defined in Text.XML.HaXml.Types

Methods

compare :: QName -> QName -> Ordering #

(<) :: QName -> QName -> Bool #

(<=) :: QName -> QName -> Bool #

(>) :: QName -> QName -> Bool #

(>=) :: QName -> QName -> Bool #

max :: QName -> QName -> QName #

min :: QName -> QName -> QName #

Show QName # 
Instance details

Defined in Text.XML.HaXml.Types

Methods

showsPrec :: Int -> QName -> ShowS #

show :: QName -> String #

showList :: [QName] -> ShowS #

data Namespace #

Namespaces are not defined in the XML spec itself, but at http://www.w3.org/TR/xml-names

Constructors

Namespace 

Fields

Instances
Eq Namespace # 
Instance details

Defined in Text.XML.HaXml.Types

Show Namespace # 
Instance details

Defined in Text.XML.HaXml.Types

Basic value types

type Name = String #

type Names = [Name] #

type NmTokens = [NmToken] #