HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Modulexml-conduit-1.10.0.0Haskell2010

Text.XML

DOM-based parsing and rendering.

This module requires that all entities be resolved at parsing. If you need to interact with unresolved entities, please use Text.XML.Unresolved. This is the recommended module for most uses cases.

While many of the datatypes in this module are simply re-exported from Data.XML.Types, Document, Node and Element are all redefined here to disallow the possibility of unresolved entities. Conversion functions are provided to switch between the two sets of datatypes.

For simpler, bidirectional traversal of the DOM tree, see the Text.XML.Cursor module.

  • 13 types
  • 27 values

Data types

9 declarations
datadata Prologue
#
Instances7Eq, Data, Ord, Show, Generic, NFData, …
datadata Instruction
#
Instances7Eq, Data, Ord, Show, Generic, NFData, …
datadata Miscellaneous
#
Instances7Eq, Data, Ord, Show, Generic, NFData, …
datadata Element
#
Instances6Eq, Data, Ord, Show, NFData, ToMarkup
  • Eq ElementDefined in xml-conduit-1.10.0.0 · Text.XML
  • Data ElementDefined in xml-conduit-1.10.0.0 · Text.XML
  • Ord ElementDefined in xml-conduit-1.10.0.0 · Text.XML
  • Show ElementDefined in xml-conduit-1.10.0.0 · Text.XML
  • NFData ElementDefined in xml-conduit-1.10.0.0 · Text.XML
  • ToMarkup ElementDefined in xml-conduit-1.10.0.0 · Text.XML

    Note that the special element name {http:/www.snoyman.comxml2html}ie-cond with the single attribute cond is used to indicate an IE conditional comment.

datadata Name
#

A fully qualified name.

Prefixes are not semantically important; they are included only to simplify pass-through parsing. When comparing names with Eq or Ord methods, prefixes are ignored.

The IsString instance supports Clark notation; see http://www.jclark.com/xml/xmlns.htm and http://infohost.nmt.edu/tcc/help/pubs/pylxml/etree-QName.html. Use the OverloadedStrings language extension for very simple Name construction:

myname :: Name
myname = "{http://example.com/ns/my-namespace}my-name"
Instances8Eq, Data, Ord, Show, IsString, Generic, …
datadata Doctype
#

Note: due to the incredible complexity of DTDs, this type only supports external subsets. I've tried adding internal subset types, but they quickly gain more code than the rest of this module put together.

It is possible that some future version of this library might support internal subsets, but I am no longer actively working on adding them.

Instances7Eq, Data, Ord, Show, Generic, NFData, …
datadata ExternalID
#
Instances7Eq, Data, Ord, Show, Generic, NFData, …

Parsing

0 declarations

Files

Bytes

Text

Other

Rendering

4 declarations

Settings

1 declaration
methoddef :: a
#

The default value for this type.

Parsing

Entity decoding

Default implementation of DecodeEntities, which leaves the entity as-is. Numeric character references and the five standard entities (lt, gt, amp, quot, pos) are handled internally by the parser.

HTML4-compliant entity decoder. Handles the additional 248 entities defined by HTML 4 and XHTML 1.

Note that HTML 5 introduces a drastically larger number of entities, and this code does not recognize most of them.

Rendering

valuersNamespaces :: RenderSettings -> [(Text, Text)]
#

Defines some top level namespace definitions to be used, in the form of (prefix, namespace). This has absolutely no impact on the meaning of your documents, but can increase readability by moving commonly used namespace declarations to the top level.

valueorderAttrs :: [(Name, [Name])] -> Name -> Map Name Text -> [(Name, Text)]
#

Convenience function to create an ordering function suitable for use as the value of rsAttrOrder. The ordering function is created from an explicit ordering of the attributes, specified as a list of tuples, as follows: In each tuple, the first component is the Name of an element, and the second component is a list of attributes names. When the given element is rendered, the attributes listed, when present, appear first in the given order, followed by any other attributes in arbitrary order. If an element does not appear, all of its attributes are rendered in arbitrary order.

Conversion

6 declarations