HaXml-1.25.3: 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)] Source

Symbol table operations

addST :: String -> a -> SymTab a -> SymTab a Source

XML Types

The top-level document container

data Document i Source

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

Constructors

Document Prolog (SymTab EntityDef) (Element i) [Misc] 

The main document content

data ElemTag Source

Constructors

ElemTag QName [Attribute] 

Instances

data Content i Source

Constructors

CElem (Element i) i 
CString Bool CharData i

bool is whether whitespace is significant

CRef Reference i 
CMisc Misc i 

info :: Content t -> t Source

Administrative parts of the document

The DTD

content model

data Modifier Source

Constructors

None

Just One

Query

Zero Or One

Star

Zero Or More

Plus

One Or More

data Mixed Source

Constructors

PCDATA 
PCDATAplus [QName] 

attribute model

data FIXED Source

Constructors

FIXED 

conditional sections

data Ignore Source

Constructors

Ignore 

References

Entities

data PEDecl Source

Constructors

PEDecl Name PEDef 

newtype NDataDecl Source

Constructors

NDATA Name 

data EV Source

Instances

Namespaces

data QName Source

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

Constructors

N Name 
QN Namespace Name 

data Namespace Source

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

Constructors

Namespace 

Fields

nsPrefix :: String
 
nsURI :: String
 

Basic value types

type Names = [Name] Source