A non-validating XML parser. For the input grammar, see http://www.w3.org/TR/REC-xml.
Parse a whole document
xmlParse :: String -> String -> DocumentSource
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 DocumentSource
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 DocTypeDeclSource
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)Source
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
.