This file is indexed.

/usr/share/doc/libghc-xml-conduit-doc/html/Text-XML-Cursor.html is in libghc-xml-conduit-doc 1.1.0.9-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
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
<!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.XML.Cursor</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-XML-Cursor.html");};
//]]>
</script></head><body><div id="package-header"><ul class="links" id="page-menu"><li><a href="src/Text-XML-Cursor.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">xml-conduit-1.1.0.9: Pure-Haskell utilities for dealing with XML with the conduit package.</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.XML.Cursor</p></div><div id="table-of-contents"><p class="caption">Contents</p><ul><li><a href="#g:1">Data types
</a></li><li><a href="#g:2">Production
</a></li><li><a href="#g:3">Axes
</a><ul><li><a href="#g:4">Filters
</a></li></ul></li><li><a href="#g:5">Operators
</a></li><li><a href="#g:6">Type classes
</a></li><li><a href="#g:7">Error handling
</a></li></ul></div><div id="description"><p class="caption">Description</p><div class="doc"><p>This module provides for simple DOM traversal. It is inspired by XPath. There are two central concepts here:
</p><ul><li> A <code><a href="Text-XML-Cursor.html#t:Cursor">Cursor</a></code> represents a node in the DOM. It also contains information on the node's <em>location</em>. While the <code><a href="Text-XML.html#t:Node">Node</a></code> datatype will only know of its children, a <code>Cursor</code> knows about its parent and siblings as well. (The underlying mechanism allowing this is called a zipper, see <a href="http://www.haskell.org/haskellwiki/Zipper">http://www.haskell.org/haskellwiki/Zipper</a> and <a href="http://www.haskell.org/haskellwiki/Tying_the_Knot">http://www.haskell.org/haskellwiki/Tying_the_Knot</a>.)
</li><li> An <code><a href="Text-XML-Cursor.html#t:Axis">Axis</a></code>, in its simplest form, takes a <code>Cursor</code> and returns a list of <code>Cursor</code>s. It is used for selections, such as finding children, ancestors, etc. Axes can be chained together to express complex rules, such as all children named <em>foo</em>.
</li></ul><p>The terminology used in this module is taken directly from the XPath
 specification: <a href="http://www.w3.org/TR/xpath/">http://www.w3.org/TR/xpath/</a>. For those familiar with XPath,
 the one major difference is that attributes are not considered nodes in this
 module.
</p></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">type</span> <a href="#t:Cursor">Cursor</a> = <a href="Text-XML-Cursor-Generic.html#t:Cursor">Cursor</a> <a href="Text-XML.html#t:Node">Node</a></li><li class="src short"><span class="keyword">type</span> <a href="#t:Axis">Axis</a> = <a href="Text-XML-Cursor.html#t:Cursor">Cursor</a> -&gt; [<a href="Text-XML-Cursor.html#t:Cursor">Cursor</a>]</li><li class="src short"><a href="#v:fromDocument">fromDocument</a> :: <a href="Text-XML.html#t:Document">Document</a> -&gt; <a href="Text-XML-Cursor.html#t:Cursor">Cursor</a></li><li class="src short"><a href="#v:fromNode">fromNode</a> :: <a href="Text-XML.html#t:Node">Node</a> -&gt; <a href="Text-XML-Cursor.html#t:Cursor">Cursor</a></li><li class="src short"><a href="#v:cut">cut</a> :: <a href="Text-XML-Cursor.html#t:Cursor">Cursor</a> -&gt; <a href="Text-XML-Cursor.html#t:Cursor">Cursor</a></li><li class="src short"><a href="#v:parent">parent</a> ::  <a href="Text-XML-Cursor-Generic.html#t:Axis">Axis</a> node</li><li class="src short"><a href="#v:precedingSibling">precedingSibling</a> ::  <a href="Text-XML-Cursor-Generic.html#t:Axis">Axis</a> node</li><li class="src short"><a href="#v:followingSibling">followingSibling</a> ::  <a href="Text-XML-Cursor-Generic.html#t:Axis">Axis</a> node</li><li class="src short"><a href="#v:child">child</a> :: <a href="Text-XML-Cursor-Generic.html#t:Cursor">Cursor</a> node -&gt; [<a href="Text-XML-Cursor-Generic.html#t:Cursor">Cursor</a> node]</li><li class="src short"><a href="#v:node">node</a> :: <a href="Text-XML-Cursor-Generic.html#t:Cursor">Cursor</a> node -&gt; node</li><li class="src short"><a href="#v:preceding">preceding</a> ::  <a href="Text-XML-Cursor-Generic.html#t:Axis">Axis</a> node</li><li class="src short"><a href="#v:following">following</a> ::  <a href="Text-XML-Cursor-Generic.html#t:Axis">Axis</a> node</li><li class="src short"><a href="#v:ancestor">ancestor</a> ::  <a href="Text-XML-Cursor-Generic.html#t:Axis">Axis</a> node</li><li class="src short"><a href="#v:descendant">descendant</a> ::  <a href="Text-XML-Cursor-Generic.html#t:Axis">Axis</a> node</li><li class="src short"><a href="#v:orSelf">orSelf</a> ::  <a href="Text-XML-Cursor-Generic.html#t:Axis">Axis</a> node -&gt; <a href="Text-XML-Cursor-Generic.html#t:Axis">Axis</a> node</li><li class="src short"><a href="#v:check">check</a> :: <a href="Text-XML-Cursor.html#t:Boolean">Boolean</a> b =&gt; (<a href="Text-XML-Cursor.html#t:Cursor">Cursor</a> -&gt; b) -&gt; <a href="Text-XML-Cursor.html#t:Axis">Axis</a></li><li class="src short"><a href="#v:checkNode">checkNode</a> :: <a href="Text-XML-Cursor.html#t:Boolean">Boolean</a> b =&gt; (<a href="Text-XML.html#t:Node">Node</a> -&gt; b) -&gt; <a href="Text-XML-Cursor.html#t:Axis">Axis</a></li><li class="src short"><a href="#v:checkElement">checkElement</a> :: <a href="Text-XML-Cursor.html#t:Boolean">Boolean</a> b =&gt; (<a href="Text-XML.html#t:Element">Element</a> -&gt; b) -&gt; <a href="Text-XML-Cursor.html#t:Axis">Axis</a></li><li class="src short"><a href="#v:checkName">checkName</a> :: <a href="Text-XML-Cursor.html#t:Boolean">Boolean</a> b =&gt; (<a href="Text-XML.html#t:Name">Name</a> -&gt; b) -&gt; <a href="Text-XML-Cursor.html#t:Axis">Axis</a></li><li class="src short"><a href="#v:anyElement">anyElement</a> :: <a href="Text-XML-Cursor.html#t:Axis">Axis</a></li><li class="src short"><a href="#v:element">element</a> :: <a href="Text-XML.html#t:Name">Name</a> -&gt; <a href="Text-XML-Cursor.html#t:Axis">Axis</a></li><li class="src short"><a href="#v:laxElement">laxElement</a> :: <a href="/usr/share/doc/libghc-text-doc/html/Data-Text-Internal.html#t:Text">Text</a> -&gt; <a href="Text-XML-Cursor.html#t:Axis">Axis</a></li><li class="src short"><a href="#v:content">content</a> :: <a href="Text-XML-Cursor.html#t:Cursor">Cursor</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:attribute">attribute</a> :: <a href="Text-XML.html#t:Name">Name</a> -&gt; <a href="Text-XML-Cursor.html#t:Cursor">Cursor</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:laxAttribute">laxAttribute</a> :: <a href="/usr/share/doc/libghc-text-doc/html/Data-Text-Internal.html#t:Text">Text</a> -&gt; <a href="Text-XML-Cursor.html#t:Cursor">Cursor</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:hasAttribute">hasAttribute</a> :: <a href="Text-XML.html#t:Name">Name</a> -&gt; <a href="Text-XML-Cursor.html#t:Axis">Axis</a></li><li class="src short"><a href="#v:attributeIs">attributeIs</a> :: <a href="Text-XML.html#t:Name">Name</a> -&gt; <a href="/usr/share/doc/libghc-text-doc/html/Data-Text-Internal.html#t:Text">Text</a> -&gt; <a href="Text-XML-Cursor.html#t:Axis">Axis</a></li><li class="src short"><a href="#v:-38--124-">(&amp;|)</a> ::  (<a href="Text-XML-Cursor-Generic.html#t:Cursor">Cursor</a> node -&gt; [a]) -&gt; (a -&gt; b) -&gt; <a href="Text-XML-Cursor-Generic.html#t:Cursor">Cursor</a> node -&gt; [b]</li><li class="src short"><a href="#v:-38--47-">(&amp;/)</a> ::  <a href="Text-XML-Cursor-Generic.html#t:Axis">Axis</a> node -&gt; (<a href="Text-XML-Cursor-Generic.html#t:Cursor">Cursor</a> node -&gt; [a]) -&gt; <a href="Text-XML-Cursor-Generic.html#t:Cursor">Cursor</a> node -&gt; [a]</li><li class="src short"><a href="#v:-38--47--47-">(&amp;//)</a> ::  <a href="Text-XML-Cursor-Generic.html#t:Axis">Axis</a> node -&gt; (<a href="Text-XML-Cursor-Generic.html#t:Cursor">Cursor</a> node -&gt; [a]) -&gt; <a href="Text-XML-Cursor-Generic.html#t:Cursor">Cursor</a> node -&gt; [a]</li><li class="src short"><a href="#v:-38-.-47--47-">(&amp;.//)</a> ::  <a href="Text-XML-Cursor-Generic.html#t:Axis">Axis</a> node -&gt; (<a href="Text-XML-Cursor-Generic.html#t:Cursor">Cursor</a> node -&gt; [a]) -&gt; <a href="Text-XML-Cursor-Generic.html#t:Cursor">Cursor</a> node -&gt; [a]</li><li class="src short"><a href="#v:-36--124-">($|)</a> ::  <a href="Text-XML-Cursor-Generic.html#t:Cursor">Cursor</a> node -&gt; (<a href="Text-XML-Cursor-Generic.html#t:Cursor">Cursor</a> node -&gt; a) -&gt; a</li><li class="src short"><a href="#v:-36--47-">($/)</a> ::  <a href="Text-XML-Cursor-Generic.html#t:Cursor">Cursor</a> node -&gt; (<a href="Text-XML-Cursor-Generic.html#t:Cursor">Cursor</a> node -&gt; [a]) -&gt; [a]</li><li class="src short"><a href="#v:-36--47--47-">($//)</a> ::  <a href="Text-XML-Cursor-Generic.html#t:Cursor">Cursor</a> node -&gt; (<a href="Text-XML-Cursor-Generic.html#t:Cursor">Cursor</a> node -&gt; [a]) -&gt; [a]</li><li class="src short"><a href="#v:-36-.-47--47-">($.//)</a> ::  <a href="Text-XML-Cursor-Generic.html#t:Cursor">Cursor</a> node -&gt; (<a href="Text-XML-Cursor-Generic.html#t:Cursor">Cursor</a> node -&gt; [a]) -&gt; [a]</li><li class="src short"><a href="#v:-62--61--62-">(&gt;=&gt;)</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Monad.html#t:Monad">Monad</a> m =&gt; (a -&gt; m b) -&gt; (b -&gt; m c) -&gt; a -&gt; m c</li><li class="src short"><span class="keyword">class</span>  <a href="#t:Boolean">Boolean</a> a  <span class="keyword">where</span><ul class="subs"><li><a href="#v:bool">bool</a> :: a -&gt; <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Bool.html#t:Bool">Bool</a></li></ul></li><li class="src short"><a href="#v:force">force</a> :: <a href="/usr/share/doc/libghc-failure-doc/html/Control-Failure.html#t:Failure">Failure</a> e f =&gt; e -&gt; [a] -&gt; f a</li><li class="src short"><a href="#v:forceM">forceM</a> :: <a href="/usr/share/doc/libghc-failure-doc/html/Control-Failure.html#t:Failure">Failure</a> e f =&gt; e -&gt; [f a] -&gt; f a</li></ul></div><div id="interface"><h1 id="g:1">Data types
</h1><div class="top"><p class="src"><span class="keyword">type</span> <a name="t:Cursor" class="def">Cursor</a> = <a href="Text-XML-Cursor-Generic.html#t:Cursor">Cursor</a> <a href="Text-XML.html#t:Node">Node</a><a href="src/Text-XML-Cursor.html#Cursor" class="link">Source</a></p><div class="doc"><p>A cursor: contains an XML <code><a href="Text-XML.html#t:Node">Node</a></code> and pointers to its children, ancestors and siblings.
</p></div></div><div class="top"><p class="src"><span class="keyword">type</span> <a name="t:Axis" class="def">Axis</a> = <a href="Text-XML-Cursor.html#t:Cursor">Cursor</a> -&gt; [<a href="Text-XML-Cursor.html#t:Cursor">Cursor</a>]<a href="src/Text-XML-Cursor.html#Axis" class="link">Source</a></p><div class="doc"><p>The type of an Axis that returns a list of Cursors.
 They are roughly modeled after <a href="http://www.w3.org/TR/xpath/#axes">http://www.w3.org/TR/xpath/#axes</a>.
</p><p>Axes can be composed with <code><a href="Text-XML-Cursor.html#v:-62--61--62-">&gt;=&gt;</a></code>, where e.g. <code>f &gt;=&gt; g</code> means that on all results of
 the <code>f</code> axis, the <code>g</code> axis will be applied, and all results joined together. 
 Because Axis is just a type synonym for <code>Cursor -&gt; [Cursor]</code>, it is possible to use
 other standard functions like <code><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Monad.html#v:-62--62--61-">&gt;&gt;=</a></code> or <code><a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-List.html#v:concatMap">concatMap</a></code> similarly.
</p><p>The operators <code>&amp;|</code>, <code>&amp;/</code>, <code>&amp;//</code> and <code>&amp;.//</code> can be used to combine axes so that the second
 axis works on the context nodes, children, descendants, respectively the context node as 
 well as its descendants of the results of the first axis.
</p><p>The operators <code>$|</code>, <code>$/</code>, <code>$//</code> and <code>$.//</code> can be used to apply an axis (right-hand side)
 to a cursor so that it is applied on the cursor itself, its children, its descendants,
 respectively itself and its descendants.
</p><p>Note that many of these operators also work on <em>generalised Axes</em> that can return 
 lists of something other than Cursors, for example Content elements.
</p></div></div><h1 id="g:2">Production
</h1><div class="top"><p class="src"><a name="v:fromDocument" class="def">fromDocument</a> :: <a href="Text-XML.html#t:Document">Document</a> -&gt; <a href="Text-XML-Cursor.html#t:Cursor">Cursor</a><a href="src/Text-XML-Cursor.html#fromDocument" class="link">Source</a></p><div class="doc"><p>Convert a <code><a href="Text-XML.html#t:Document">Document</a></code> to a <code><a href="Text-XML-Cursor.html#t:Cursor">Cursor</a></code>. It will point to the document root.
</p></div></div><div class="top"><p class="src"><a name="v:fromNode" class="def">fromNode</a> :: <a href="Text-XML.html#t:Node">Node</a> -&gt; <a href="Text-XML-Cursor.html#t:Cursor">Cursor</a><a href="src/Text-XML-Cursor.html#fromNode" class="link">Source</a></p><div class="doc"><p>Convert a <code><a href="Text-XML.html#t:Node">Node</a></code> to a <code><a href="Text-XML-Cursor.html#t:Cursor">Cursor</a></code> (without parents).
</p></div></div><div class="top"><p class="src"><a name="v:cut" class="def">cut</a> :: <a href="Text-XML-Cursor.html#t:Cursor">Cursor</a> -&gt; <a href="Text-XML-Cursor.html#t:Cursor">Cursor</a><a href="src/Text-XML-Cursor.html#cut" class="link">Source</a></p><div class="doc"><p>Cut a cursor off from its parent. The idea is to allow restricting the scope of queries on it.
</p></div></div><h1 id="g:3">Axes
</h1><div class="top"><p class="src"><a name="v:parent" class="def">parent</a> ::  <a href="Text-XML-Cursor-Generic.html#t:Axis">Axis</a> node<a href="src/Text-XML-Cursor-Generic.html#parent" class="link">Source</a></p><div class="doc"><p>The parent axis. As described in XPath:
 <em>the parent axis contains the parent of the context node, if there is one</em>.
</p><p>Every node but the root element of the document has a parent. Parent nodes
 will always be <code>NodeElement</code>s.
</p></div></div><div class="top"><p class="src"><a name="v:precedingSibling" class="def">precedingSibling</a> ::  <a href="Text-XML-Cursor-Generic.html#t:Axis">Axis</a> node<a href="src/Text-XML-Cursor-Generic.html#precedingSibling" class="link">Source</a></p><div class="doc"><p>The preceding-sibling axis. XPath:
 <em>the preceding-sibling axis contains all the preceding siblings of the context node [...]</em>.
</p></div></div><div class="top"><p class="src"><a name="v:followingSibling" class="def">followingSibling</a> ::  <a href="Text-XML-Cursor-Generic.html#t:Axis">Axis</a> node<a href="src/Text-XML-Cursor-Generic.html#followingSibling" class="link">Source</a></p><div class="doc"><p>The following-sibling axis. XPath:
 <em>the following-sibling axis contains all the following siblings of the context node [...]</em>.
</p></div></div><div class="top"><p class="src"><a name="v:child" class="def">child</a> :: <a href="Text-XML-Cursor-Generic.html#t:Cursor">Cursor</a> node -&gt; [<a href="Text-XML-Cursor-Generic.html#t:Cursor">Cursor</a> node]<a href="src/Text-XML-Cursor-Generic.html#child" class="link">Source</a></p><div class="doc"><p>The child axis. XPath:
 <em>the child axis contains the children of the context node</em>.
</p></div></div><div class="top"><p class="src"><a name="v:node" class="def">node</a> :: <a href="Text-XML-Cursor-Generic.html#t:Cursor">Cursor</a> node -&gt; node<a href="src/Text-XML-Cursor-Generic.html#node" class="link">Source</a></p><div class="doc"><p>The current node.
</p></div></div><div class="top"><p class="src"><a name="v:preceding" class="def">preceding</a> ::  <a href="Text-XML-Cursor-Generic.html#t:Axis">Axis</a> node<a href="src/Text-XML-Cursor-Generic.html#preceding" class="link">Source</a></p><div class="doc"><p>The preceding axis. XPath:
 <em>the preceding axis contains all nodes in the same document as the context node that are before the context node in document order, excluding any ancestors and excluding attribute nodes and namespace nodes</em>.
</p></div></div><div class="top"><p class="src"><a name="v:following" class="def">following</a> ::  <a href="Text-XML-Cursor-Generic.html#t:Axis">Axis</a> node<a href="src/Text-XML-Cursor-Generic.html#following" class="link">Source</a></p><div class="doc"><p>The following axis. XPath:
 <em>the following axis contains all nodes in the same document as the context node that are after the context node in document order, excluding any descendants and excluding attribute nodes and namespace nodes</em>.
</p></div></div><div class="top"><p class="src"><a name="v:ancestor" class="def">ancestor</a> ::  <a href="Text-XML-Cursor-Generic.html#t:Axis">Axis</a> node<a href="src/Text-XML-Cursor-Generic.html#ancestor" class="link">Source</a></p><div class="doc"><p>The ancestor axis. XPath:
 <em>the ancestor axis contains the ancestors of the context node; the ancestors of the context node consist of the parent of context node and the parent's parent and so on; thus, the ancestor axis will always include the root node, unless the context node is the root node</em>.
</p></div></div><div class="top"><p class="src"><a name="v:descendant" class="def">descendant</a> ::  <a href="Text-XML-Cursor-Generic.html#t:Axis">Axis</a> node<a href="src/Text-XML-Cursor-Generic.html#descendant" class="link">Source</a></p><div class="doc"><p>The descendant axis. XPath:
 <em>the descendant axis contains the descendants of the context node; a descendant is a child or a child of a child and so on; thus the descendant axis never contains attribute or namespace nodes</em>.
</p></div></div><div class="top"><p class="src"><a name="v:orSelf" class="def">orSelf</a> ::  <a href="Text-XML-Cursor-Generic.html#t:Axis">Axis</a> node -&gt; <a href="Text-XML-Cursor-Generic.html#t:Axis">Axis</a> node<a href="src/Text-XML-Cursor-Generic.html#orSelf" class="link">Source</a></p><div class="doc"><p>Modify an axis by adding the context node itself as the first element of the result list.
</p></div></div><h2 id="g:4">Filters
</h2><div class="top"><p class="src"><a name="v:check" class="def">check</a> :: <a href="Text-XML-Cursor.html#t:Boolean">Boolean</a> b =&gt; (<a href="Text-XML-Cursor.html#t:Cursor">Cursor</a> -&gt; b) -&gt; <a href="Text-XML-Cursor.html#t:Axis">Axis</a><a href="src/Text-XML-Cursor.html#check" class="link">Source</a></p><div class="doc"><p>Filter cursors that don't pass a check.
</p></div></div><div class="top"><p class="src"><a name="v:checkNode" class="def">checkNode</a> :: <a href="Text-XML-Cursor.html#t:Boolean">Boolean</a> b =&gt; (<a href="Text-XML.html#t:Node">Node</a> -&gt; b) -&gt; <a href="Text-XML-Cursor.html#t:Axis">Axis</a><a href="src/Text-XML-Cursor.html#checkNode" class="link">Source</a></p><div class="doc"><p>Filter nodes that don't pass a check.
</p></div></div><div class="top"><p class="src"><a name="v:checkElement" class="def">checkElement</a> :: <a href="Text-XML-Cursor.html#t:Boolean">Boolean</a> b =&gt; (<a href="Text-XML.html#t:Element">Element</a> -&gt; b) -&gt; <a href="Text-XML-Cursor.html#t:Axis">Axis</a><a href="src/Text-XML-Cursor.html#checkElement" class="link">Source</a></p><div class="doc"><p>Filter elements that don't pass a check, and remove all non-elements.
</p></div></div><div class="top"><p class="src"><a name="v:checkName" class="def">checkName</a> :: <a href="Text-XML-Cursor.html#t:Boolean">Boolean</a> b =&gt; (<a href="Text-XML.html#t:Name">Name</a> -&gt; b) -&gt; <a href="Text-XML-Cursor.html#t:Axis">Axis</a><a href="src/Text-XML-Cursor.html#checkName" class="link">Source</a></p><div class="doc"><p>Filter elements that don't pass a name check, and remove all non-elements.
</p></div></div><div class="top"><p class="src"><a name="v:anyElement" class="def">anyElement</a> :: <a href="Text-XML-Cursor.html#t:Axis">Axis</a><a href="src/Text-XML-Cursor.html#anyElement" class="link">Source</a></p><div class="doc"><p>Remove all non-elements. Compare roughly to XPath:
 <em>A node test * is true for any node of the principal node type. For example, child::* will select all element children of the context node [...]</em>.
</p></div></div><div class="top"><p class="src"><a name="v:element" class="def">element</a> :: <a href="Text-XML.html#t:Name">Name</a> -&gt; <a href="Text-XML-Cursor.html#t:Axis">Axis</a><a href="src/Text-XML-Cursor.html#element" class="link">Source</a></p><div class="doc"><p>Select only those elements with a matching tag name. XPath:
 <em>A node test that is a QName is true if and only if the type of the node (see [5 Data Model]) is the principal node type and has an expanded-name equal to the expanded-name specified by the QName.</em>
</p></div></div><div class="top"><p class="src"><a name="v:laxElement" class="def">laxElement</a> :: <a href="/usr/share/doc/libghc-text-doc/html/Data-Text-Internal.html#t:Text">Text</a> -&gt; <a href="Text-XML-Cursor.html#t:Axis">Axis</a><a href="src/Text-XML-Cursor.html#laxElement" class="link">Source</a></p><div class="doc"><p>Select only those elements with a loosely matching tag name. Namespace and case are ignored. XPath:
 <em>A node test that is a QName is true if and only if the type of the node (see [5 Data Model]) is the principal node type and has an expanded-name equal to the expanded-name specified by the QName.</em>
</p></div></div><div class="top"><p class="src"><a name="v:content" class="def">content</a> :: <a href="Text-XML-Cursor.html#t:Cursor">Cursor</a> -&gt; [<a href="/usr/share/doc/libghc-text-doc/html/Data-Text-Internal.html#t:Text">Text</a>]<a href="src/Text-XML-Cursor.html#content" class="link">Source</a></p><div class="doc"><p>Select only text nodes, and directly give the <code>Content</code> values. XPath:
 <em>The node test text() is true for any text node.</em>
</p><p>Note that this is not strictly an <code><a href="Text-XML-Cursor.html#t:Axis">Axis</a></code>, but will work with most combinators.
</p></div></div><div class="top"><p class="src"><a name="v:attribute" class="def">attribute</a> :: <a href="Text-XML.html#t:Name">Name</a> -&gt; <a href="Text-XML-Cursor.html#t:Cursor">Cursor</a> -&gt; [<a href="/usr/share/doc/libghc-text-doc/html/Data-Text-Internal.html#t:Text">Text</a>]<a href="src/Text-XML-Cursor.html#attribute" class="link">Source</a></p><div class="doc"><p>Select attributes on the current element (or nothing if it is not an element). XPath:
 <em>the attribute axis contains the attributes of the context node; the axis will be empty unless the context node is an element</em>
</p><p>Note that this is not strictly an <code><a href="Text-XML-Cursor.html#t:Axis">Axis</a></code>, but will work with most combinators.
</p><p>The return list of the generalised axis contains as elements lists of <code>Content</code> 
 elements, each full list representing an attribute value.
</p></div></div><div class="top"><p class="src"><a name="v:laxAttribute" class="def">laxAttribute</a> :: <a href="/usr/share/doc/libghc-text-doc/html/Data-Text-Internal.html#t:Text">Text</a> -&gt; <a href="Text-XML-Cursor.html#t:Cursor">Cursor</a> -&gt; [<a href="/usr/share/doc/libghc-text-doc/html/Data-Text-Internal.html#t:Text">Text</a>]<a href="src/Text-XML-Cursor.html#laxAttribute" class="link">Source</a></p><div class="doc"><p>Select attributes on the current element (or nothing if it is not an element).  Namespace and case are ignored. XPath:
 <em>the attribute axis contains the attributes of the context node; the axis will be empty unless the context node is an element</em>
</p><p>Note that this is not strictly an <code><a href="Text-XML-Cursor.html#t:Axis">Axis</a></code>, but will work with most combinators.
</p><p>The return list of the generalised axis contains as elements lists of <code>Content</code> 
 elements, each full list representing an attribute value.
</p></div></div><div class="top"><p class="src"><a name="v:hasAttribute" class="def">hasAttribute</a> :: <a href="Text-XML.html#t:Name">Name</a> -&gt; <a href="Text-XML-Cursor.html#t:Axis">Axis</a><a href="src/Text-XML-Cursor.html#hasAttribute" class="link">Source</a></p><div class="doc"><p>Select only those element nodes with the given attribute.
</p></div></div><div class="top"><p class="src"><a name="v:attributeIs" class="def">attributeIs</a> :: <a href="Text-XML.html#t:Name">Name</a> -&gt; <a href="/usr/share/doc/libghc-text-doc/html/Data-Text-Internal.html#t:Text">Text</a> -&gt; <a href="Text-XML-Cursor.html#t:Axis">Axis</a><a href="src/Text-XML-Cursor.html#attributeIs" class="link">Source</a></p><div class="doc"><p>Select only those element nodes containing the given attribute key/value pair.
</p></div></div><h1 id="g:5">Operators
</h1><div class="top"><p class="src"><a name="v:-38--124-" class="def">(&amp;|)</a> ::  (<a href="Text-XML-Cursor-Generic.html#t:Cursor">Cursor</a> node -&gt; [a]) -&gt; (a -&gt; b) -&gt; <a href="Text-XML-Cursor-Generic.html#t:Cursor">Cursor</a> node -&gt; [b]<a href="src/Text-XML-Cursor-Generic.html#%26%7C" class="link">Source</a></p><div class="doc"><p>Apply a function to the result of an axis.
</p></div></div><div class="top"><p class="src"><a name="v:-38--47-" class="def">(&amp;/)</a> ::  <a href="Text-XML-Cursor-Generic.html#t:Axis">Axis</a> node -&gt; (<a href="Text-XML-Cursor-Generic.html#t:Cursor">Cursor</a> node -&gt; [a]) -&gt; <a href="Text-XML-Cursor-Generic.html#t:Cursor">Cursor</a> node -&gt; [a]<a href="src/Text-XML-Cursor-Generic.html#%26%2F" class="link">Source</a></p><div class="doc"><p>Combine two axes so that the second works on the children of the results
 of the first.
</p></div></div><div class="top"><p class="src"><a name="v:-38--47--47-" class="def">(&amp;//)</a> ::  <a href="Text-XML-Cursor-Generic.html#t:Axis">Axis</a> node -&gt; (<a href="Text-XML-Cursor-Generic.html#t:Cursor">Cursor</a> node -&gt; [a]) -&gt; <a href="Text-XML-Cursor-Generic.html#t:Cursor">Cursor</a> node -&gt; [a]<a href="src/Text-XML-Cursor-Generic.html#%26%2F%2F" class="link">Source</a></p><div class="doc"><p>Combine two axes so that the second works on the descendants of the results
 of the first.
</p></div></div><div class="top"><p class="src"><a name="v:-38-.-47--47-" class="def">(&amp;.//)</a> ::  <a href="Text-XML-Cursor-Generic.html#t:Axis">Axis</a> node -&gt; (<a href="Text-XML-Cursor-Generic.html#t:Cursor">Cursor</a> node -&gt; [a]) -&gt; <a href="Text-XML-Cursor-Generic.html#t:Cursor">Cursor</a> node -&gt; [a]<a href="src/Text-XML-Cursor-Generic.html#%26.%2F%2F" class="link">Source</a></p><div class="doc"><p>Combine two axes so that the second works on both the result nodes, and their
 descendants.
</p></div></div><div class="top"><p class="src"><a name="v:-36--124-" class="def">($|)</a> ::  <a href="Text-XML-Cursor-Generic.html#t:Cursor">Cursor</a> node -&gt; (<a href="Text-XML-Cursor-Generic.html#t:Cursor">Cursor</a> node -&gt; a) -&gt; a<a href="src/Text-XML-Cursor-Generic.html#%24%7C" class="link">Source</a></p><div class="doc"><p>Apply an axis to a 'Cursor node'.
</p></div></div><div class="top"><p class="src"><a name="v:-36--47-" class="def">($/)</a> ::  <a href="Text-XML-Cursor-Generic.html#t:Cursor">Cursor</a> node -&gt; (<a href="Text-XML-Cursor-Generic.html#t:Cursor">Cursor</a> node -&gt; [a]) -&gt; [a]<a href="src/Text-XML-Cursor-Generic.html#%24%2F" class="link">Source</a></p><div class="doc"><p>Apply an axis to the children of a 'Cursor node'.
</p></div></div><div class="top"><p class="src"><a name="v:-36--47--47-" class="def">($//)</a> ::  <a href="Text-XML-Cursor-Generic.html#t:Cursor">Cursor</a> node -&gt; (<a href="Text-XML-Cursor-Generic.html#t:Cursor">Cursor</a> node -&gt; [a]) -&gt; [a]<a href="src/Text-XML-Cursor-Generic.html#%24%2F%2F" class="link">Source</a></p><div class="doc"><p>Apply an axis to the descendants of a 'Cursor node'.
</p></div></div><div class="top"><p class="src"><a name="v:-36-.-47--47-" class="def">($.//)</a> ::  <a href="Text-XML-Cursor-Generic.html#t:Cursor">Cursor</a> node -&gt; (<a href="Text-XML-Cursor-Generic.html#t:Cursor">Cursor</a> node -&gt; [a]) -&gt; [a]<a href="src/Text-XML-Cursor-Generic.html#%24.%2F%2F" class="link">Source</a></p><div class="doc"><p>Apply an axis to a 'Cursor node' as well as its descendants.
</p></div></div><div class="top"><p class="src"><a name="v:-62--61--62-" class="def">(&gt;=&gt;)</a> :: <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Control-Monad.html#t:Monad">Monad</a> m =&gt; (a -&gt; m b) -&gt; (b -&gt; m c) -&gt; a -&gt; m c</p><div class="doc"><p>Left-to-right Kleisli composition of monads.
</p></div></div><h1 id="g:6">Type classes
</h1><div class="top"><p class="src"><span class="keyword">class</span>  <a name="t:Boolean" class="def">Boolean</a> a  <span class="keyword">where</span><a href="src/Text-XML-Cursor.html#Boolean" class="link">Source</a></p><div class="doc"><p>Something that can be used in a predicate check as a boolean.
</p></div><div class="subs methods"><p class="caption">Methods</p><p class="src"><a name="v:bool" class="def">bool</a> :: 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-XML-Cursor.html#bool" class="link">Source</a></p></div><div class="subs instances"><p id="control.i:Boolean" class="caption collapser" onclick="toggleSection('i:Boolean')">Instances</p><div id="section.i:Boolean" class="show"><table><tr><td class="src"><a href="Text-XML-Cursor.html#t:Boolean">Boolean</a> <a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Bool.html#t:Bool">Bool</a></td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="Text-XML-Cursor.html#t:Boolean">Boolean</a> [a]</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="Text-XML-Cursor.html#t:Boolean">Boolean</a> (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Maybe.html#t:Maybe">Maybe</a> a)</td><td class="doc empty">&nbsp;</td></tr><tr><td class="src"><a href="Text-XML-Cursor.html#t:Boolean">Boolean</a> (<a href="/usr/share/doc/ghc-doc/html/libraries/base-4.6.0.1/Data-Either.html#t:Either">Either</a> a b)</td><td class="doc empty">&nbsp;</td></tr></table></div></div></div><h1 id="g:7">Error handling
</h1><div class="top"><p class="src"><a name="v:force" class="def">force</a> :: <a href="/usr/share/doc/libghc-failure-doc/html/Control-Failure.html#t:Failure">Failure</a> e f =&gt; e -&gt; [a] -&gt; f a<a href="src/Text-XML-Cursor.html#force" class="link">Source</a></p></div><div class="top"><p class="src"><a name="v:forceM" class="def">forceM</a> :: <a href="/usr/share/doc/libghc-failure-doc/html/Control-Failure.html#t:Failure">Failure</a> e f =&gt; e -&gt; [f a] -&gt; f a<a href="src/Text-XML-Cursor.html#forceM" 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>