Modulexml-1.3.14Haskell98
Text.XML.Light.Cursor
XML cursors for working XML content withing the context of an XML document. This implementation is based on the general tree zipper written by Krasimir Angelov and Iavor S. Diatchki.
Contents
Synopsis
- data Tag
- value getTag
- value setTag
- value fromTag
- data Cursor
- type Path
- value fromContent
- value fromElement
- value fromForest
- value toForest
- value toTree
- value parent
- value root
- value getChild
- value firstChild
- value lastChild
- value left
- value right
- value nextDF
- value findChild
- value findLeft
- value findRight
- value findRec
- value isRoot
- value isFirst
- value isLast
- value isLeaf
- value isChild
- value hasChildren
- value getNodeIndex
- value setContent
- value modifyContent
- value modifyContentM
- value insertLeft
- value insertRight
- value insertGoLeft
- value insertGoRight
- value removeLeft
- value removeRight
- value removeGoLeft
- value removeGoRight
- value removeGoUp
- Packagexml-1.3.14
- Exports42
- LanguageHaskell98
- LicenceBSD-3-Clause
- SourceCursor.hs
The position of a piece of content in an XML document.
Conversions
A cursor for the given content.
A cursor for the given element.
The location of the first tree in a forest.
Computes the forest containing this location.
Computes the tree containing this location.
Moving around
The parent of the given location.
The top-most parent of the given location.
The child with the given index (starting from 0).
The first child of the given location.
The last child of the given location.
The left sibling of the given location.
The right sibling of the given location.
The next position in a left-to-right depth-first traversal of a document: either the first child, right sibling, or the right sibling of a parent that has one.
Searching
The first child that satisfies a predicate.
Find the next left sibling that satisfies a predicate.
Find the next right sibling that satisfies a predicate.
Perform a depth first search for a descendant that satisfies the given predicate.
Node classification
Are we at the top of the document?
Are we at the left end of the the document?
Are we at the right end of the document?
Are we at the bottom of the document?
Do we have a parent?
Do we have children?
Get the node index inside the sequence of children
Updates
Change the current content.
Modify the current content.
Modify the current content, allowing for an effect.
Inserting content
Insert content to the left of the current position.
Insert content to the right of the current position.
Insert content to the left of the current position. The new content becomes the current position.
Insert content to the right of the current position. The new content becomes the current position.
Removing content
Remove the content on the left of the current position, if any.
Remove the content on the right of the current position, if any.
Remove the current element. The new position is the one on the left.
Remove the current element. The new position is the one on the right.
Remove the current element. The new position is the parent of the old position.