hexpat-lens-0.0.5: Lenses for Hexpat.

Portabilitynon-portable
Stabilityexperimental
Maintainerme@jspha.com
Safe HaskellNone

Text.XML.Expat.Lens.Parse

Description

XML parsing Prisms from Hexpat. HTML parsing Isos from TagSoup.

While Hexpat offers lazy, incremental parsing and this can improve performance, we must force the parse to completion in order to provide a Prism, so the lazy parsing is not offered here.

Synopsis

Documentation

_XML :: (GenericXMLString tag, GenericXMLString text) => Prism' ByteString (NodeG [] tag text)Source

Strict parsing and formatting of XML via format' and parse'.

_XMLWithOptions :: (GenericXMLString tag, GenericXMLString text) => ParseOptions tag text -> Prism' ByteString (NodeG [] tag text)Source

Provides an '_XMLWithOptions parsing Prism with access to the ParsingOptions.

_HTML :: GenericXMLString text => Iso' ByteString (UNode text)Source

Uses tag soup parsing to build a UNode tree. Technically a retract, since _HTML tries very hard to return *something*, we get an Iso instead of a Prism.

view (from _HTML . _HTML) = id

_HTML' :: GenericXMLString text => Iso' ByteString (UNode text)Source

Uses tag soup parsing to build a UNode tree. Technically a retract, since _HTML tries very hard to return *something*, we get an Iso instead of a Prism. Uses the *fast* tag soup parsing options.

view (from _HTML' . _HTML') = id

_HTMLWithOptions :: GenericXMLString text => ParseOptions ByteString -> Iso' ByteString (UNode text)Source

Like '_HTML but allows choice of ParseOptions.