HORIZON HASKELLDocslts/ghc-10.0.x8fef28d2026-11-02Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8fef28d · 2026-11-02

Moduletaggy-0.2.1Haskell2010

Text.Taggy.DOM

This module will help you represent an HTML or XML document as a tree and let you traverse it in whatever way you like.

This is especially useful when used in conjunction with taggy-lens

Synopsis
  • Packagetaggy-0.2.1
  • Exports9
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceDOM.hs
datadata Element

An Element here refers to a tag name, the attributes specified withing that tag, and all the children nodes of that element. An Element is basically anything but "raw" content.

Constructors

Instances3Eq, Show, AsMarkup
valueparseDOM :: Bool -> Text -> [Node]

Parse an HTML or XML document as a DOM tree.

The Bool argument lets you specify whether you want to convert HTML entities to their corresponding unicode characters, just like in Text.Taggy.Parser.

parseDOM convertEntities = domify . taggyWith cventities
valuedomify :: [Tag] -> [Node]

Transform a list of tags (produced with taggyWith) into a list of toplevel nodes. If the document you're working on is valid, there should only be one toplevel node, but let's not assume we're living in an ideal world.