|
| Text.XML.Light.Cursor | | Portability | portable | | Stability | provisional | | Maintainer | Iavor S. Diatchki <diatchki@galois.com> |
|
|
|
|
|
| Description |
| 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.
|
|
| Synopsis |
|
|
|
| Documentation |
|
|
|
|
|
|
|
|
|
|
|
| The position of a piece of content in an XML document.
| | Constructors | | Cur | | | current :: Content | The currently selected content.
| | lefts :: [Content] | Siblings on the left, closest first.
| | rights :: [Content] | Siblings on the right, closest first.
| | parents :: Path | The contexts of the parent elements of this location.
|
|
|
|
|
|
|
| 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.
|
|
| Produced by Haddock version 2.6.0 |