MkOneOf

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

The main document content

data Element i

Constructors

Elem QName [Attribute] [Content i] 

Instances

data ElemTag

Constructors

ElemTag QName [Attribute] 

Instances

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

info :: Content t -> t

Administrative parts of the document

data Prolog

Constructors

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

Instances

data Misc

Instances

type SDDecl = Bool

The DTD

content model

data DocTypeDecl

Constructors

DTD QName (Maybe ExternalID) [MarkupDecl] 

Instances

data ExtSubset

Instances

data ElementDecl

Instances

data ContentSpec

Constructors

EMPTY 
ANY 
Mixed Mixed 
ContentSpec CP 

Instances

data CP

Instances

data Modifier

Constructors

None

Just One

Query

Zero Or One

Star

Zero Or More

Plus

One Or More

Instances

data Mixed

Constructors

PCDATA 
PCDATAplus [QName] 

Instances

attribute model

data AttListDecl

Constructors

AttListDecl QName [AttDef] 

Instances

data AttDef

Instances

data FIXED

Constructors

FIXED 

Instances

conditional sections

data Ignore

Constructors

Ignore 

Instances

References

type CharRef = Int

Entities

data GEDecl

Constructors

GEDecl Name EntityDef 

Instances

data PEDecl

Constructors

PEDecl Name PEDef 

Instances

newtype NDataDecl

Constructors

NDATA Name 

Instances

data TextDecl

Instances

data ExtParsedEnt i

Constructors

ExtParsedEnt (Maybe TextDecl) (Content i) 

Instances

Eq i => Eq (ExtParsedEnt i) 

data ExtPE

Constructors

ExtPE (Maybe TextDecl) [ExtSubsetDecl] 

Instances

newtype PublicID

Constructors

PUBLICID PubidLiteral 

Instances

newtype EncodingDecl

Constructors

EncodingDecl String 

Instances

data EntityValue

Constructors

EntityValue [EV] 

data EV

Instances

Namespaces

data QName

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

Constructors

N Name 
QN Namespace Name 

Instances

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
 

Basic value types

type Name = String

type Names = [Name]

type NmTokens = [NmToken]