| HaXml | Contents | Index

Text.XML.HaXml.Parse

Contents

Parse a whole document
Parse just a DTD

Description
A non-validating XML parser. For the input grammar, see http://www.w3.org/TR/REC-xml.
Synopsis

xmlParse :: String -> String -> Document
xmlParse' :: String -> String -> Either String Document
dtdParse :: String -> String -> Maybe DocTypeDecl
dtdParse' :: String -> String -> Either String (Maybe DocTypeDecl)

Parse a whole document
xmlParse :: String -> String -> Document
To parse a whole document, `xmlParse file content` takes a filename (for generating error reports) and the string content of that file. A parse error causes program failure, with message to stderr.
xmlParse' :: String -> String -> Either String Document
To parse a whole document, `xmlParse' file content` takes a filename (for generating error reports) and the string content of that file. Any parse error message is passed back to the caller through the `Either` type.
Parse just a DTD
dtdParse :: String -> String -> Maybe DocTypeDecl
To parse just a DTD, `dtdParse file content` takes a filename (for generating error reports) and the string content of that file. If no DTD was found, you get `Nothing` rather than an error. However, if a DTD is found but contains errors, the program crashes.
dtdParse' :: String -> String -> Either String (Maybe DocTypeDecl)
To parse just a DTD, `dtdParse' file content` takes a filename (for generating error reports) and the string content of that file. If no DTD was found, you get `Right Nothing`. If a DTD was found but contains errors, you get a `Left message`.
Produced by Haddock version 0.8