This file is indexed.

/usr/share/doc/libghc-xmlhtml-doc/html/Text-XmlHtml.html is in libghc-xmlhtml-doc 0.2.3-1build2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Text.XmlHtml</title><link href="ocean.css" rel="stylesheet" type="text/css" title="Ocean" /><script src="haddock-util.js" type="text/javascript"></script><script type="text/javascript">//<![CDATA[
window.onload = function () {pageLoad();setSynopsis("mini_Text-XmlHtml.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/Text-XmlHtml.html">Source</a></li><li><a href="index.html">Contents</a></li><li><a href="doc-index.html">Index</a></li></ul><p class="caption">xmlhtml-0.2.3: XML parser and renderer with HTML 5 quirks mode</p></div><div id="content"><div id="module-header"><table class="info"><tr><th>Safe Haskell</th><td>None</td></tr></table><p class="caption">Text.XmlHtml</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">Types
</a></li><li><a href="#g:2">Manipulating documents
</a></li><li><a href="#g:3">Parsing
</a></li><li><a href="#g:4">Rendering
</a></li></ul></div><div id="description"><p class="caption">Description</p><div class="doc"><p>Parsers and renderers for XML and HTML 5.  Although the formats are
   treated differently, the data types used by each are the same, which
   makes it easy to write code that works with the element structure of
   either XML or HTML 5 documents.
</p><p>Limitations:
</p><ul><li> The XML parser does not parse internal DOCTYPE subsets.  They are just
     stored as blocks of text, with minimal scanning done to match quotes
     and brackets to determine the end.
</li><li> Since DTDs are not parsed, the XML parser fails on entity references,
     except for those defined internally.  You cannot use this library for
     parsing XML documents with entity references outside the predefined
     set.
</li><li> The HTML 5 parser is not a compliant HTML parser.  Instead, it is a
     parser for valid HTML 5 content.  It should only be used on content
     that you have reason to believe is probably correct, since the
     compatibility features of HTML 5 are missing.  This is the wrong
     library on which to build a web spider.
</li><li> Both parsers accept fragments of documents, by which is meant that
     they do not enforce the top-level structure of the document.  Files
     may contain more than one root element, for example.
</li></ul></div></div><div id="synopsis"><p id="control.syn" class="caption expander" onclick="toggleSection('syn')">Synopsis</p><ul id="section.syn" class="hide" onclick="toggleSection('syn')"><li class="src short"><span class="keyword">data</span>  <a href="#t:Document">Document</a> <ul class="subs"><li>= <a href="#v:XmlDocument">XmlDocument</a> { <ul class="subs"><li><a href="#v:docEncoding">docEncoding</a> :: !<a href="Text-XmlHtml.html#t:Encoding">Encoding</a></li><li><a href="#v:docType">docType</a> :: !(<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Maybe.html#t:Maybe">Maybe</a> <a href="Text-XmlHtml.html#t:DocType">DocType</a>)</li><li><a href="#v:docContent">docContent</a> :: ![<a href="Text-XmlHtml.html#t:Node">Node</a>]</li></ul> }</li><li>| <a href="#v:HtmlDocument">HtmlDocument</a> { <ul class="subs"><li><a href="#v:docEncoding">docEncoding</a> :: !<a href="Text-XmlHtml.html#t:Encoding">Encoding</a></li><li><a href="#v:docType">docType</a> :: !(<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Maybe.html#t:Maybe">Maybe</a> <a href="Text-XmlHtml.html#t:DocType">DocType</a>)</li><li><a href="#v:docContent">docContent</a> :: ![<a href="Text-XmlHtml.html#t:Node">Node</a>]</li></ul> }</li></ul></li><li class="src short"><span class="keyword">data</span>  <a href="#t:Node">Node</a> <ul class="subs"><li>= <a href="#v:TextNode">TextNode</a> !<a href="/usr/share/doc/libghc-text-doc/html/Data-Text-Internal.html#t:Text">Text</a>  </li><li>| <a href="#v:Comment">Comment</a> !<a href="/usr/share/doc/libghc-text-doc/html/Data-Text-Internal.html#t:Text">Text</a>  </li><li>| <a href="#v:Element">Element</a> { <ul class="subs"><li><a href="#v:elementTag">elementTag</a> :: !<a href="/usr/share/doc/libghc-text-doc/html/Data-Text-Internal.html#t:Text">Text</a></li><li><a href="#v:elementAttrs">elementAttrs</a> :: ![(<a href="/usr/share/doc/libghc-text-doc/html/Data-Text-Internal.html#t:Text">Text</a>, <a href="/usr/share/doc/libghc-text-doc/html/Data-Text-Internal.html#t:Text">Text</a>)]</li><li><a href="#v:elementChildren">elementChildren</a> :: ![<a href="Text-XmlHtml.html#t:Node">Node</a>]</li></ul> }</li></ul></li><li class="src short"><span class="keyword">data</span>  <a href="#t:DocType">DocType</a>  = <a href="#v:DocType">DocType</a> !<a href="/usr/share/doc/libghc-text-doc/html/Data-Text-Internal.html#t:Text">Text</a> !<a href="Text-XmlHtml.html#t:ExternalID">ExternalID</a> !<a href="Text-XmlHtml.html#t:InternalSubset">InternalSubset</a></li><li class="src short"><span class="keyword">data</span>  <a href="#t:ExternalID">ExternalID</a> <ul class="subs"><li>= <a href="#v:Public">Public</a> !<a href="/usr/share/doc/libghc-text-doc/html/Data-Text-Internal.html#t:Text">Text</a> !<a href="/usr/share/doc/libghc-text-doc/html/Data-Text-Internal.html#t:Text">Text</a>  </li><li>| <a href="#v:System">System</a> !<a href="/usr/share/doc/libghc-text-doc/html/Data-Text-Internal.html#t:Text">Text</a>  </li><li>| <a href="#v:NoExternalID">NoExternalID</a>  </li></ul></li><li class="src short"><span class="keyword">data</span>  <a href="#t:InternalSubset">InternalSubset</a> <ul class="subs"><li>= <a href="#v:InternalText">InternalText</a> !<a href="/usr/share/doc/libghc-text-doc/html/Data-Text-Internal.html#t:Text">Text</a>  </li><li>| <a href="#v:NoInternalSubset">NoInternalSubset</a>  </li></ul></li><li class="src short"><span class="keyword">data</span>  <a href="#t:Encoding">Encoding</a> <ul class="subs"><li>= <a href="#v:UTF8">UTF8</a>  </li><li>| <a href="#v:UTF16BE">UTF16BE</a>  </li><li>| <a href="#v:UTF16LE">UTF16LE</a>  </li></ul></li><li class="src short"><a href="#v:isTextNode">isTextNode</a> :: <a href="Text-XmlHtml.html#t:Node">Node</a> -&gt; <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:isComment">isComment</a> :: <a href="Text-XmlHtml.html#t:Node">Node</a> -&gt; <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:isElement">isElement</a> :: <a href="Text-XmlHtml.html#t:Node">Node</a> -&gt; <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:tagName">tagName</a> :: <a href="Text-XmlHtml.html#t:Node">Node</a> -&gt; <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Maybe.html#t:Maybe">Maybe</a> <a href="/usr/share/doc/libghc-text-doc/html/Data-Text-Internal.html#t:Text">Text</a></li><li class="src short"><a href="#v:getAttribute">getAttribute</a> :: <a href="/usr/share/doc/libghc-text-doc/html/Data-Text-Internal.html#t:Text">Text</a> -&gt; <a href="Text-XmlHtml.html#t:Node">Node</a> -&gt; <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Maybe.html#t:Maybe">Maybe</a> <a href="/usr/share/doc/libghc-text-doc/html/Data-Text-Internal.html#t:Text">Text</a></li><li class="src short"><a href="#v:hasAttribute">hasAttribute</a> :: <a href="/usr/share/doc/libghc-text-doc/html/Data-Text-Internal.html#t:Text">Text</a> -&gt; <a href="Text-XmlHtml.html#t:Node">Node</a> -&gt; <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Bool.html#t:Bool">Bool</a></li><li class="src short"><a href="#v:setAttribute">setAttribute</a> :: <a href="/usr/share/doc/libghc-text-doc/html/Data-Text-Internal.html#t:Text">Text</a> -&gt; <a href="/usr/share/doc/libghc-text-doc/html/Data-Text-Internal.html#t:Text">Text</a> -&gt; <a href="Text-XmlHtml.html#t:Node">Node</a> -&gt; <a href="Text-XmlHtml.html#t:Node">Node</a></li><li class="src short"><a href="#v:nodeText">nodeText</a> :: <a href="Text-XmlHtml.html#t:Node">Node</a> -&gt; <a href="/usr/share/doc/libghc-text-doc/html/Data-Text-Internal.html#t:Text">Text</a></li><li class="src short"><a href="#v:childNodes">childNodes</a> :: <a href="Text-XmlHtml.html#t:Node">Node</a> -&gt; [<a href="Text-XmlHtml.html#t:Node">Node</a>]</li><li class="src short"><a href="#v:childElements">childElements</a> :: <a href="Text-XmlHtml.html#t:Node">Node</a> -&gt; [<a href="Text-XmlHtml.html#t:Node">Node</a>]</li><li class="src short"><a href="#v:childElementsTag">childElementsTag</a> :: <a href="/usr/share/doc/libghc-text-doc/html/Data-Text-Internal.html#t:Text">Text</a> -&gt; <a href="Text-XmlHtml.html#t:Node">Node</a> -&gt; [<a href="Text-XmlHtml.html#t:Node">Node</a>]</li><li class="src short"><a href="#v:childElementTag">childElementTag</a> :: <a href="/usr/share/doc/libghc-text-doc/html/Data-Text-Internal.html#t:Text">Text</a> -&gt; <a href="Text-XmlHtml.html#t:Node">Node</a> -&gt; <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Maybe.html#t:Maybe">Maybe</a> <a href="Text-XmlHtml.html#t:Node">Node</a></li><li class="src short"><a href="#v:descendantNodes">descendantNodes</a> :: <a href="Text-XmlHtml.html#t:Node">Node</a> -&gt; [<a href="Text-XmlHtml.html#t:Node">Node</a>]</li><li class="src short"><a href="#v:descendantElements">descendantElements</a> :: <a href="Text-XmlHtml.html#t:Node">Node</a> -&gt; [<a href="Text-XmlHtml.html#t:Node">Node</a>]</li><li class="src short"><a href="#v:descendantElementsTag">descendantElementsTag</a> :: <a href="/usr/share/doc/libghc-text-doc/html/Data-Text-Internal.html#t:Text">Text</a> -&gt; <a href="Text-XmlHtml.html#t:Node">Node</a> -&gt; [<a href="Text-XmlHtml.html#t:Node">Node</a>]</li><li class="src short"><a href="#v:descendantElementTag">descendantElementTag</a> :: <a href="/usr/share/doc/libghc-text-doc/html/Data-Text-Internal.html#t:Text">Text</a> -&gt; <a href="Text-XmlHtml.html#t:Node">Node</a> -&gt; <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Maybe.html#t:Maybe">Maybe</a> <a href="Text-XmlHtml.html#t:Node">Node</a></li><li class="src short"><a href="#v:parseXML">parseXML</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a> -&gt; <a href="/usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.0.2/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Either.html#t:Either">Either</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a> <a href="Text-XmlHtml.html#t:Document">Document</a></li><li class="src short"><a href="#v:parseHTML">parseHTML</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a> -&gt; <a href="/usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.0.2/Data-ByteString.html#t:ByteString">ByteString</a> -&gt; <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Either.html#t:Either">Either</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a> <a href="Text-XmlHtml.html#t:Document">Document</a></li><li class="src short"><a href="#v:render">render</a> :: <a href="Text-XmlHtml.html#t:Document">Document</a> -&gt; <a href="/usr/share/doc/libghc-blaze-builder-doc/html/Blaze-ByteString-Builder-Internal-Types.html#t:Builder">Builder</a></li><li class="src short"><a href="#v:renderXmlFragment">renderXmlFragment</a> :: <a href="Text-XmlHtml.html#t:Encoding">Encoding</a> -&gt; [<a href="Text-XmlHtml.html#t:Node">Node</a>] -&gt; <a href="/usr/share/doc/libghc-blaze-builder-doc/html/Blaze-ByteString-Builder-Internal-Types.html#t:Builder">Builder</a></li><li class="src short"><a href="#v:renderHtmlFragment">renderHtmlFragment</a> :: <a href="Text-XmlHtml.html#t:Encoding">Encoding</a> -&gt; [<a href="Text-XmlHtml.html#t:Node">Node</a>] -&gt; <a href="/usr/share/doc/libghc-blaze-builder-doc/html/Blaze-ByteString-Builder-Internal-Types.html#t:Builder">Builder</a></li><li class="src short"><a href="#v:renderDocType">renderDocType</a> :: <a href="Text-XmlHtml.html#t:Encoding">Encoding</a> -&gt; <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Maybe.html#t:Maybe">Maybe</a> <a href="Text-XmlHtml.html#t:DocType">DocType</a> -&gt; <a href="/usr/share/doc/libghc-blaze-builder-doc/html/Blaze-ByteString-Builder-Internal-Types.html#t:Builder">Builder</a></li></ul></div><div id="interface"><h1 id="g:1">Types
</h1><div class="top"><p class="src"><span class="keyword">data</span>  <a name="t:Document" class="def">Document</a>  <a href="src/Text-XmlHtml-Common.html#Document" class="link">Source</a></p><div class="doc"><p>Represents a document fragment, including the format, encoding, and
 document type declaration as well as its content.
</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:XmlDocument" class="def">XmlDocument</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div class="subs fields"><p class="caption">Fields</p><dl><dt class="src"><a name="v:docEncoding" class="def">docEncoding</a> :: !<a href="Text-XmlHtml.html#t:Encoding">Encoding</a></dt><dd class="doc empty">&nbsp;</dd><dt class="src"><a name="v:docType" class="def">docType</a> :: !(<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Maybe.html#t:Maybe">Maybe</a> <a href="Text-XmlHtml.html#t:DocType">DocType</a>)</dt><dd class="doc empty">&nbsp;</dd><dt class="src"><a name="v:docContent" class="def">docContent</a> :: ![<a href="Text-XmlHtml.html#t:Node">Node</a>]</dt><dd class="doc empty">&nbsp;</dd></dl><div class="clear"></div></div></td></tr><tr><td class="src"><a name="v:HtmlDocument" class="def">HtmlDocument</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div class="subs fields"><p class="caption">Fields</p><dl><dt class="src"><a name="v:docEncoding" class="def">docEncoding</a> :: !<a href="Text-XmlHtml.html#t:Encoding">Encoding</a></dt><dd class="doc empty">&nbsp;</dd><dt class="src"><a name="v:docType" class="def">docType</a> :: !(<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Maybe.html#t:Maybe">Maybe</a> <a href="Text-XmlHtml.html#t:DocType">DocType</a>)</dt><dd class="doc empty">&nbsp;</dd><dt class="src"><a name="v:docContent" class="def">docContent</a> :: ![<a href="Text-XmlHtml.html#t:Node">Node</a>]</dt><dd class="doc empty">&nbsp;</dd></dl><div class="clear"></div></div></td></tr></table></div><div class="subs instances"><p id="control.i:Document" class="caption collapser" onclick="toggleSection('i:Document')">Instances</p><div id="section.i:Document" class="show"><table><tr><td class="src"><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Eq.html#t:Eq">Eq</a> <a href="Text-XmlHtml.html#t:Document">Document</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Text-Show.html#t:Show">Show</a> <a href="Text-XmlHtml.html#t:Document">Document</a></td><td class="doc empty">&nbsp;</td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">data</span>  <a name="t:Node" class="def">Node</a>  <a href="src/Text-XmlHtml-Common.html#Node" class="link">Source</a></p><div class="doc"><p>A node of a document structure.  A node can be text, a comment, or an
 element.  XML processing instructions are intentionally omitted as a
 simplification, and CDATA and plain text are both text nodes, since they
 ought to be semantically interchangeable.
</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:TextNode" class="def">TextNode</a> !<a href="/usr/share/doc/libghc-text-doc/html/Data-Text-Internal.html#t:Text">Text</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a name="v:Comment" class="def">Comment</a> !<a href="/usr/share/doc/libghc-text-doc/html/Data-Text-Internal.html#t:Text">Text</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a name="v:Element" class="def">Element</a></td><td class="doc empty">&nbsp;</td></tr><tr><td colspan="2"><div class="subs fields"><p class="caption">Fields</p><dl><dt class="src"><a name="v:elementTag" class="def">elementTag</a> :: !<a href="/usr/share/doc/libghc-text-doc/html/Data-Text-Internal.html#t:Text">Text</a></dt><dd class="doc empty">&nbsp;</dd><dt class="src"><a name="v:elementAttrs" class="def">elementAttrs</a> :: ![(<a href="/usr/share/doc/libghc-text-doc/html/Data-Text-Internal.html#t:Text">Text</a>, <a href="/usr/share/doc/libghc-text-doc/html/Data-Text-Internal.html#t:Text">Text</a>)]</dt><dd class="doc empty">&nbsp;</dd><dt class="src"><a name="v:elementChildren" class="def">elementChildren</a> :: ![<a href="Text-XmlHtml.html#t:Node">Node</a>]</dt><dd class="doc empty">&nbsp;</dd></dl><div class="clear"></div></div></td></tr></table></div><div class="subs instances"><p id="control.i:Node" class="caption collapser" onclick="toggleSection('i:Node')">Instances</p><div id="section.i:Node" class="show"><table><tr><td class="src"><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Eq.html#t:Eq">Eq</a> <a href="Text-XmlHtml.html#t:Node">Node</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Text-Show.html#t:Show">Show</a> <a href="Text-XmlHtml.html#t:Node">Node</a></td><td class="doc empty">&nbsp;</td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">data</span>  <a name="t:DocType" class="def">DocType</a>  <a href="src/Text-XmlHtml-Common.html#DocType" class="link">Source</a></p><div class="doc"><p>A document type declaration.  Note that DTD internal subsets are
 currently unimplemented.
</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:DocType" class="def">DocType</a> !<a href="/usr/share/doc/libghc-text-doc/html/Data-Text-Internal.html#t:Text">Text</a> !<a href="Text-XmlHtml.html#t:ExternalID">ExternalID</a> !<a href="Text-XmlHtml.html#t:InternalSubset">InternalSubset</a></td><td class="doc empty">&nbsp;</td></tr></table></div><div class="subs instances"><p id="control.i:DocType" class="caption collapser" onclick="toggleSection('i:DocType')">Instances</p><div id="section.i:DocType" class="show"><table><tr><td class="src"><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Eq.html#t:Eq">Eq</a> <a href="Text-XmlHtml.html#t:DocType">DocType</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Text-Show.html#t:Show">Show</a> <a href="Text-XmlHtml.html#t:DocType">DocType</a></td><td class="doc empty">&nbsp;</td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">data</span>  <a name="t:ExternalID" class="def">ExternalID</a>  <a href="src/Text-XmlHtml-Common.html#ExternalID" class="link">Source</a></p><div class="doc"><p>An external ID, as in a document type declaration.  This can be a
 SYSTEM identifier, or a PUBLIC identifier, or can be omitted.
</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:Public" class="def">Public</a> !<a href="/usr/share/doc/libghc-text-doc/html/Data-Text-Internal.html#t:Text">Text</a> !<a href="/usr/share/doc/libghc-text-doc/html/Data-Text-Internal.html#t:Text">Text</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a name="v:System" class="def">System</a> !<a href="/usr/share/doc/libghc-text-doc/html/Data-Text-Internal.html#t:Text">Text</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a name="v:NoExternalID" class="def">NoExternalID</a></td><td class="doc empty">&nbsp;</td></tr></table></div><div class="subs instances"><p id="control.i:ExternalID" class="caption collapser" onclick="toggleSection('i:ExternalID')">Instances</p><div id="section.i:ExternalID" class="show"><table><tr><td class="src"><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Eq.html#t:Eq">Eq</a> <a href="Text-XmlHtml.html#t:ExternalID">ExternalID</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Text-Show.html#t:Show">Show</a> <a href="Text-XmlHtml.html#t:ExternalID">ExternalID</a></td><td class="doc empty">&nbsp;</td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">data</span>  <a name="t:InternalSubset" class="def">InternalSubset</a>  <a href="src/Text-XmlHtml-Common.html#InternalSubset" class="link">Source</a></p><div class="doc"><p>The internal subset is unparsed, but preserved in case it's actually
 wanted.
</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:InternalText" class="def">InternalText</a> !<a href="/usr/share/doc/libghc-text-doc/html/Data-Text-Internal.html#t:Text">Text</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a name="v:NoInternalSubset" class="def">NoInternalSubset</a></td><td class="doc empty">&nbsp;</td></tr></table></div><div class="subs instances"><p id="control.i:InternalSubset" class="caption collapser" onclick="toggleSection('i:InternalSubset')">Instances</p><div id="section.i:InternalSubset" class="show"><table><tr><td class="src"><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Eq.html#t:Eq">Eq</a> <a href="Text-XmlHtml.html#t:InternalSubset">InternalSubset</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Text-Show.html#t:Show">Show</a> <a href="Text-XmlHtml.html#t:InternalSubset">InternalSubset</a></td><td class="doc empty">&nbsp;</td></tr></table></div></div></div><div class="top"><p class="src"><span class="keyword">data</span>  <a name="t:Encoding" class="def">Encoding</a>  <a href="src/Text-XmlHtml-Common.html#Encoding" class="link">Source</a></p><div class="doc"><p>The character encoding of a document.  Currently only the required
 character encodings are implemented.
</p></div><div class="subs constructors"><p class="caption">Constructors</p><table><tr><td class="src"><a name="v:UTF8" class="def">UTF8</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a name="v:UTF16BE" class="def">UTF16BE</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a name="v:UTF16LE" class="def">UTF16LE</a></td><td class="doc empty">&nbsp;</td></tr></table></div><div class="subs instances"><p id="control.i:Encoding" class="caption collapser" onclick="toggleSection('i:Encoding')">Instances</p><div id="section.i:Encoding" class="show"><table><tr><td class="src"><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Eq.html#t:Eq">Eq</a> <a href="Text-XmlHtml.html#t:Encoding">Encoding</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Text-Show.html#t:Show">Show</a> <a href="Text-XmlHtml.html#t:Encoding">Encoding</a></td><td class="doc empty">&nbsp;</td></tr></table></div></div></div><h1 id="g:2">Manipulating documents
</h1><div class="top"><p class="src"><a name="v:isTextNode" class="def">isTextNode</a> :: <a href="Text-XmlHtml.html#t:Node">Node</a> -&gt; <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Bool.html#t:Bool">Bool</a><a href="src/Text-XmlHtml-Common.html#isTextNode" class="link">Source</a></p><div class="doc"><p>Determines whether the node is text or not.
</p></div></div><div class="top"><p class="src"><a name="v:isComment" class="def">isComment</a> :: <a href="Text-XmlHtml.html#t:Node">Node</a> -&gt; <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Bool.html#t:Bool">Bool</a><a href="src/Text-XmlHtml-Common.html#isComment" class="link">Source</a></p><div class="doc"><p>Determines whether the node is a comment or not.
</p></div></div><div class="top"><p class="src"><a name="v:isElement" class="def">isElement</a> :: <a href="Text-XmlHtml.html#t:Node">Node</a> -&gt; <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Bool.html#t:Bool">Bool</a><a href="src/Text-XmlHtml-Common.html#isElement" class="link">Source</a></p><div class="doc"><p>Determines whether the node is an element or not.
</p></div></div><div class="top"><p class="src"><a name="v:tagName" class="def">tagName</a> :: <a href="Text-XmlHtml.html#t:Node">Node</a> -&gt; <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Maybe.html#t:Maybe">Maybe</a> <a href="/usr/share/doc/libghc-text-doc/html/Data-Text-Internal.html#t:Text">Text</a><a href="src/Text-XmlHtml-Common.html#tagName" class="link">Source</a></p><div class="doc"><p>Gives the tag name of an element, or <code><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Maybe.html#v:Nothing">Nothing</a></code> if the node isn't an
 element.
</p></div></div><div class="top"><p class="src"><a name="v:getAttribute" class="def">getAttribute</a> :: <a href="/usr/share/doc/libghc-text-doc/html/Data-Text-Internal.html#t:Text">Text</a> -&gt; <a href="Text-XmlHtml.html#t:Node">Node</a> -&gt; <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Maybe.html#t:Maybe">Maybe</a> <a href="/usr/share/doc/libghc-text-doc/html/Data-Text-Internal.html#t:Text">Text</a><a href="src/Text-XmlHtml-Common.html#getAttribute" class="link">Source</a></p><div class="doc"><p>Retrieves the attribute with the given name.  If the <code><a href="Text-XmlHtml.html#t:Node">Node</a></code> is not an
 element, the result is always <code><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Maybe.html#v:Nothing">Nothing</a></code>
</p></div></div><div class="top"><p class="src"><a name="v:hasAttribute" class="def">hasAttribute</a> :: <a href="/usr/share/doc/libghc-text-doc/html/Data-Text-Internal.html#t:Text">Text</a> -&gt; <a href="Text-XmlHtml.html#t:Node">Node</a> -&gt; <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Bool.html#t:Bool">Bool</a><a href="src/Text-XmlHtml-Common.html#hasAttribute" class="link">Source</a></p><div class="doc"><p>Checks if a given attribute exists in a <code><a href="Text-XmlHtml.html#t:Node">Node</a></code>.
</p></div></div><div class="top"><p class="src"><a name="v:setAttribute" class="def">setAttribute</a> :: <a href="/usr/share/doc/libghc-text-doc/html/Data-Text-Internal.html#t:Text">Text</a> -&gt; <a href="/usr/share/doc/libghc-text-doc/html/Data-Text-Internal.html#t:Text">Text</a> -&gt; <a href="Text-XmlHtml.html#t:Node">Node</a> -&gt; <a href="Text-XmlHtml.html#t:Node">Node</a><a href="src/Text-XmlHtml-Common.html#setAttribute" class="link">Source</a></p><div class="doc"><p>Sets the attribute name to the given value.  If the <code><a href="Text-XmlHtml.html#t:Node">Node</a></code> is not an
 element, this is the identity.
</p></div></div><div class="top"><p class="src"><a name="v:nodeText" class="def">nodeText</a> :: <a href="Text-XmlHtml.html#t:Node">Node</a> -&gt; <a href="/usr/share/doc/libghc-text-doc/html/Data-Text-Internal.html#t:Text">Text</a><a href="src/Text-XmlHtml-Common.html#nodeText" class="link">Source</a></p><div class="doc"><p>Gives the entire text content of a node, ignoring markup.
</p></div></div><div class="top"><p class="src"><a name="v:childNodes" class="def">childNodes</a> :: <a href="Text-XmlHtml.html#t:Node">Node</a> -&gt; [<a href="Text-XmlHtml.html#t:Node">Node</a>]<a href="src/Text-XmlHtml-Common.html#childNodes" class="link">Source</a></p><div class="doc"><p>Gives the child nodes of the given node.  Only elements have child nodes.
</p></div></div><div class="top"><p class="src"><a name="v:childElements" class="def">childElements</a> :: <a href="Text-XmlHtml.html#t:Node">Node</a> -&gt; [<a href="Text-XmlHtml.html#t:Node">Node</a>]<a href="src/Text-XmlHtml-Common.html#childElements" class="link">Source</a></p><div class="doc"><p>Gives the child elements of the given node.
</p></div></div><div class="top"><p class="src"><a name="v:childElementsTag" class="def">childElementsTag</a> :: <a href="/usr/share/doc/libghc-text-doc/html/Data-Text-Internal.html#t:Text">Text</a> -&gt; <a href="Text-XmlHtml.html#t:Node">Node</a> -&gt; [<a href="Text-XmlHtml.html#t:Node">Node</a>]<a href="src/Text-XmlHtml-Common.html#childElementsTag" class="link">Source</a></p><div class="doc"><p>Gives all of the child elements of the node with the given tag
 name.
</p></div></div><div class="top"><p class="src"><a name="v:childElementTag" class="def">childElementTag</a> :: <a href="/usr/share/doc/libghc-text-doc/html/Data-Text-Internal.html#t:Text">Text</a> -&gt; <a href="Text-XmlHtml.html#t:Node">Node</a> -&gt; <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Maybe.html#t:Maybe">Maybe</a> <a href="Text-XmlHtml.html#t:Node">Node</a><a href="src/Text-XmlHtml-Common.html#childElementTag" class="link">Source</a></p><div class="doc"><p>Gives the first child element of the node with the given tag name,
 or <code><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Maybe.html#v:Nothing">Nothing</a></code> if there is no such child element.
</p></div></div><div class="top"><p class="src"><a name="v:descendantNodes" class="def">descendantNodes</a> :: <a href="Text-XmlHtml.html#t:Node">Node</a> -&gt; [<a href="Text-XmlHtml.html#t:Node">Node</a>]<a href="src/Text-XmlHtml-Common.html#descendantNodes" class="link">Source</a></p><div class="doc"><p>Gives the descendants of the given node in the order that they begin in
 the document.
</p></div></div><div class="top"><p class="src"><a name="v:descendantElements" class="def">descendantElements</a> :: <a href="Text-XmlHtml.html#t:Node">Node</a> -&gt; [<a href="Text-XmlHtml.html#t:Node">Node</a>]<a href="src/Text-XmlHtml-Common.html#descendantElements" class="link">Source</a></p><div class="doc"><p>Gives the descendant elements of the given node, in the order that their
 start tags appear in the document.
</p></div></div><div class="top"><p class="src"><a name="v:descendantElementsTag" class="def">descendantElementsTag</a> :: <a href="/usr/share/doc/libghc-text-doc/html/Data-Text-Internal.html#t:Text">Text</a> -&gt; <a href="Text-XmlHtml.html#t:Node">Node</a> -&gt; [<a href="Text-XmlHtml.html#t:Node">Node</a>]<a href="src/Text-XmlHtml-Common.html#descendantElementsTag" class="link">Source</a></p><div class="doc"><p>Gives the descendant elements with a given tag name.
</p></div></div><div class="top"><p class="src"><a name="v:descendantElementTag" class="def">descendantElementTag</a> :: <a href="/usr/share/doc/libghc-text-doc/html/Data-Text-Internal.html#t:Text">Text</a> -&gt; <a href="Text-XmlHtml.html#t:Node">Node</a> -&gt; <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Maybe.html#t:Maybe">Maybe</a> <a href="Text-XmlHtml.html#t:Node">Node</a><a href="src/Text-XmlHtml-Common.html#descendantElementTag" class="link">Source</a></p><div class="doc"><p>Gives the first descendant element of the node with the given tag name,
 or <code><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Maybe.html#v:Nothing">Nothing</a></code> if there is no such element.
</p></div></div><h1 id="g:3">Parsing
</h1><div class="top"><p class="src"><a name="v:parseXML" class="def">parseXML</a><a href="src/Text-XmlHtml.html#parseXML" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a></td><td class="doc"><p>Name of document source (perhaps a filename) for error messages
</p></td></tr><tr><td class="src">-&gt; <a href="/usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.0.2/Data-ByteString.html#t:ByteString">ByteString</a></td><td class="doc"><p>Document contents
</p></td></tr><tr><td class="src">-&gt; <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Either.html#t:Either">Either</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a> <a href="Text-XmlHtml.html#t:Document">Document</a></td><td class="doc"><p>The document or an error message
</p></td></tr></table></div><div class="doc"><p>Parses the given XML fragment.
</p></div></div><div class="top"><p class="src"><a name="v:parseHTML" class="def">parseHTML</a><a href="src/Text-XmlHtml.html#parseHTML" class="link">Source</a></p><div class="subs arguments"><p class="caption">Arguments</p><table><tr><td class="src">:: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a></td><td class="doc"><p>Name of document source (perhaps a filename) for error messages
</p></td></tr><tr><td class="src">-&gt; <a href="/usr/share/doc/ghc-doc/html/libraries/bytestring-0.10.0.2/Data-ByteString.html#t:ByteString">ByteString</a></td><td class="doc"><p>Document contents
</p></td></tr><tr><td class="src">-&gt; <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Either.html#t:Either">Either</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-String.html#t:String">String</a> <a href="Text-XmlHtml.html#t:Document">Document</a></td><td class="doc"><p>The document or an error message
</p></td></tr></table></div><div class="doc"><p>Parses the given HTML fragment.  This enables HTML quirks mode, which
   changes the parsing algorithm to parse valid HTML 5 documents correctly.
</p></div></div><h1 id="g:4">Rendering
</h1><div class="top"><p class="src"><a name="v:render" class="def">render</a> :: <a href="Text-XmlHtml.html#t:Document">Document</a> -&gt; <a href="/usr/share/doc/libghc-blaze-builder-doc/html/Blaze-ByteString-Builder-Internal-Types.html#t:Builder">Builder</a><a href="src/Text-XmlHtml.html#render" class="link">Source</a></p><div class="doc"><p>Renders a <code><a href="Text-XmlHtml.html#t:Document">Document</a></code>.
</p></div></div><div class="top"><p class="src"><a name="v:renderXmlFragment" class="def">renderXmlFragment</a> :: <a href="Text-XmlHtml.html#t:Encoding">Encoding</a> -&gt; [<a href="Text-XmlHtml.html#t:Node">Node</a>] -&gt; <a href="/usr/share/doc/libghc-blaze-builder-doc/html/Blaze-ByteString-Builder-Internal-Types.html#t:Builder">Builder</a><a href="src/Text-XmlHtml-XML-Render.html#renderXmlFragment" class="link">Source</a></p><div class="doc"><p>Function for rendering XML nodes without the overhead of creating a
 Document structure.
</p></div></div><div class="top"><p class="src"><a name="v:renderHtmlFragment" class="def">renderHtmlFragment</a> :: <a href="Text-XmlHtml.html#t:Encoding">Encoding</a> -&gt; [<a href="Text-XmlHtml.html#t:Node">Node</a>] -&gt; <a href="/usr/share/doc/libghc-blaze-builder-doc/html/Blaze-ByteString-Builder-Internal-Types.html#t:Builder">Builder</a><a href="src/Text-XmlHtml-HTML-Render.html#renderHtmlFragment" class="link">Source</a></p><div class="doc"><p>Function for rendering HTML nodes without the overhead of creating a
 Document structure.
</p></div></div><div class="top"><p class="src"><a name="v:renderDocType" class="def">renderDocType</a> :: <a href="Text-XmlHtml.html#t:Encoding">Encoding</a> -&gt; <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Maybe.html#t:Maybe">Maybe</a> <a href="Text-XmlHtml.html#t:DocType">DocType</a> -&gt; <a href="/usr/share/doc/libghc-blaze-builder-doc/html/Blaze-ByteString-Builder-Internal-Types.html#t:Builder">Builder</a><a href="src/Text-XmlHtml.html#renderDocType" class="link">Source</a></p></div></div></div><div id="footer"><p>Produced by <a href="http://www.haskell.org/haddock/">Haddock</a> version 2.13.2</p></div></body></html>