HaXml-1.23.3: Utilities for manipulating XML documents

Safe HaskellSafe-Inferred

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

lookupST :: String -> SymTab a -> Maybe 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 
Eq (Document i) 

The main document content

data Element i

Constructors

Elem QName [Attribute] [Content i] 

Instances

Functor Element 
Eq (Element i) 
Verbatim (Element i) 

data ElemTag

Constructors

ElemTag QName [Attribute] 

Instances

Eq ElemTag 

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 
Eq (Content i) 
Verbatim (Content i) 

data AttValue

Constructors

AttValue [Either String Reference] 

Instances

info :: Content t -> t

Administrative parts of the document

data Prolog

Constructors

Prolog (Maybe XMLDecl) [Misc] (Maybe DocTypeDecl) [Misc] 

Instances

Eq Prolog 

data XMLDecl

Constructors

XMLDecl VersionInfo (Maybe EncodingDecl) (Maybe SDDecl) 

Instances

Eq XMLDecl 

data Misc

Instances

Eq Misc 

type SDDecl = Bool

type VersionInfo = String

type Comment = String

type PITarget = String

The DTD

content model

data DocTypeDecl

Constructors

DTD QName (Maybe ExternalID) [MarkupDecl] 

Instances

data ExtSubset

Constructors

ExtSubset (Maybe TextDecl) [ExtSubsetDecl] 

Instances

data ElementDecl

Instances

data ContentSpec

Constructors

EMPTY 
ANY 
Mixed Mixed 
ContentSpec CP 

Instances

data CP

Instances

Eq CP 
Show CP 
Show CP 

data Modifier

Constructors

None

Just One

Query

Zero Or One

Star

Zero Or More

Plus

One Or More

Instances

Eq Modifier 
Show Modifier 
Show Modifier 

data Mixed

Constructors

PCDATA 
PCDATAplus [QName] 

Instances

Eq Mixed 

attribute model

data AttListDecl

Constructors

AttListDecl QName [AttDef] 

Instances

data AttDef

Instances

Eq AttDef 

data TokenizedType

Instances

data DefaultDecl

Constructors

REQUIRED 
IMPLIED 
DefaultTo AttValue (Maybe FIXED) 

Instances

data FIXED

Constructors

FIXED 

Instances

Eq FIXED 

conditional sections

data Ignore

Constructors

Ignore 

Instances

Eq Ignore 

References

type CharRef = Int

Entities

data EntityDecl

Instances

data GEDecl

Constructors

GEDecl Name EntityDef 

Instances

Eq GEDecl 

data PEDecl

Constructors

PEDecl Name PEDef 

Instances

Eq PEDecl 

data PEDef

Instances

Eq PEDef 
Show PEDef 

newtype NDataDecl

Constructors

NDATA Name 

Instances

data TextDecl

Constructors

TextDecl (Maybe VersionInfo) EncodingDecl 

Instances

data ExtParsedEnt i

Constructors

ExtParsedEnt (Maybe TextDecl) (Content i) 

Instances

Eq (ExtParsedEnt i) 

data ExtPE

Constructors

ExtPE (Maybe TextDecl) [ExtSubsetDecl] 

Instances

Eq ExtPE 

data NotationDecl

Constructors

NOTATION Name (Either ExternalID PublicID) 

Instances

newtype PublicID

Constructors

PUBLICID PubidLiteral 

Instances

newtype EncodingDecl

Constructors

EncodingDecl String 

Instances

data EntityValue

Constructors

EntityValue [EV] 

Instances

data EV

Constructors

EVString String 
EVRef Reference 

Instances

Eq EV 
Show EV 

newtype PubidLiteral

Constructors

PubidLiteral String 

Instances

newtype SystemLiteral

Constructors

SystemLiteral String 

Instances

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 
Ord QName 
Show QName 

data Namespace

Namespaces are not defined in the XML spec itself, but at http:www.w3.orgTRxml-names

Constructors

Namespace 

Fields

nsPrefix :: String
 
nsURI :: String
 

Instances

Eq Namespace 
Show Namespace 

Basic value types

type Name = String

type Names = [Name]

type NmToken = String

type NmTokens = [NmToken]

type CharData = String