Library for processing XML data.
Warning: the structure of this library is not stable and
might be changed in the future!
Author: Michael Hanus
Version: December 2006
| Exported names: |
Datatypes:
Encoding
| XmlDocParams
| XmlExp
Constructors:
DtdUrl
| Enc
| Iso88591Enc
| StandardEnc
| XElem
| XText
Functions:
parseXmlString
| readFileWithXmlDocs
| readUnsafeXmlFile
| readXmlFile
| showXmlDoc
| showXmlDocWithParams
| textOfXml
| updateXmlFile
| writeXmlFile
| writeXmlFileWithParams
| xml
| xtxt
| Summary of exported functions: |
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
| Imported modules: |
| Exported datatypes: |
The data type for representing XML expressions.
Constructors:
:: String -> XmlExp
XText - a text string (PCDATA)
:: String -> [(String,String)] -> [XmlExp] -> XmlExp
XElem - an XML element with tag field, attributes, and a list
of XML elements as contents
The data type for encodings used in the XML document.
Constructors:
:: Encoding
:: Encoding
The data type for XML document parameters.
Constructors:
:: Encoding -> XmlDocParams
Enc - the encoding for a document
:: String -> XmlDocParams
DtdUrl - the url of the DTD for a document
| Exported functions: |
:: String -> XmlExp
Basic text (maybe containing special XML chars).
:: String -> [XmlExp] -> XmlExp
XML element without attributes.
:: String -> XmlExp -> IO ()
Writes a file with a given XML document.
:: String -> [XmlDocParams] -> XmlExp -> IO ()
Writes a file with a given XML document and XML parameters.
:: XmlExp -> String
Show an XML document in indented format as a string.
:: [XmlDocParams] -> XmlExp -> String
:: String -> IO XmlExp
Reads a file with an XML document and returns the corresponding XML expression.
:: String -> IO (Maybe XmlExp)
Tries to read a file with an XML document and returns the corresponding XML expression, if possible. If file or parse errors occur, Nothing is returned.
:: String -> IO [XmlExp]
Reads a file with an arbitrary sequence of XML documents and returns the list of corresponding XML expressions.
:: String -> [XmlExp]
Transforms an XML string into a list of XML expressions. If the XML string is a well structured document, the list of XML expressions should contain exactly one element.
:: [XmlExp] -> String
Extracts the textual contents of a list of XML expressions.
Useful auxiliary function when transforming XML expression into
other data structures.
For instance,
textOfXml [XText "xy", XElem "a" [] [], XText "ab"] == "xy ab"
:: (XmlExp -> XmlExp) -> String -> IO ()
An action that updates the contents of an XML file by some transformation on the XML document.
Example call: (updateXmlFile f file)
f
- the function to transform the XML document in the file
file
- the name of the XML file