polysoup-0.6.3: Online XML parsing with polyparse and tagsoup

Safe HaskellNone
LanguageHaskell98

Text.XML.PolySoup.XmlTree

Contents

Description

XML as a tree of XML tags.

The module provides an XmlTree data type, which can be used to represent a parsed XML file. The XmlTree structure can be generated lazily by using the parseTree (or parseForest) function on any string-like input supported by the tagsoup library.

Note, that the parsing functions do not validate correctness of the input XML data.

Synopsis

XML Tree

type XmlTree s = Tree (Tag s) Source #

A parsed XML tree. Closing tags are not preserved.

type XmlForest s = [XmlTree s] Source #

A parsed XML forest. Closing tags are not preserved.

Parsing

parseTree :: (NFData s, StringLike s) => [Tag s] -> XmlTree s Source #

Parse XML tree from a list of tags.

parseForest :: (NFData s, StringLike s) => [Tag s] -> XmlForest s Source #

Parse XML forest from a list of tags. Note, that if the XML file has additional headers, the parseForest function has to be used to parse it correctly.

Rendering

renderTree :: XmlTree s -> [Tag s] Source #

Render XML tree tags.

renderForest :: XmlForest s -> [Tag s] Source #

Render XML forest tags.