|
|
|
Description |
Type classes to allow for XML handling functions to be generalized to
work with different node types, including the ones defined in Tree and
Annotated.
|
|
Synopsis |
|
type Attributes tag text = [(tag, text)] | | type UAttributes text = Attributes text text | | textContent :: (NodeClass n [], Monoid text) => n [] tag text -> text | | class (Functor c, List c) => NodeClass n c where | | | class NodeClass n c => MkElementClass n c where | | | getAttribute :: (NodeClass n c, GenericXMLString tag) => n c tag text -> tag -> Maybe text | | setAttribute :: (Eq tag, NodeClass n c, GenericXMLString tag) => tag -> text -> n c tag text -> n c tag text | | deleteAttribute :: (Eq tag, NodeClass n c, GenericXMLString tag) => tag -> n c tag text -> n c tag text | | alterAttribute :: (Eq tag, NodeClass n c, GenericXMLString tag) => tag -> Maybe text -> n c tag text -> n c tag text |
|
|
Documentation |
|
type Attributes tag text = [(tag, text)] | Source |
|
Type shortcut for attributes
|
|
|
Type shortcut for attributes with unqualified names where tag and
text are the same string type.
|
|
|
Extract all text content from inside a tag into a single string, including
any text contained in children.
|
|
|
| Methods | | Is the given node an element?
| | | Is the given node text?
| | | Extract all text content from inside a tag into a single string, including
any text contained in children.
| | | Is the given node a tag with the given name?
| | | Get the name of this node if it's an element, return empty string otherwise.
| | getAttributes :: n c tag text -> [(tag, text)] | Source |
| Get the attributes of a node if it's an element, return empty list otherwise.
| | getChildren :: n c tag text -> c (n c tag text) | Source |
| Get children of a node if it's an element, return empty list otherwise.
| | | Get this node's text if it's a text node, return empty text otherwise.
| | modifyName :: (tag -> tag) -> n c tag text -> n c tag text | Source |
| Modify name if it's an element, no-op otherwise.
| | modifyAttributes :: ([(tag, text)] -> [(tag, text)]) -> n c tag text -> n c tag text | Source |
| Modify attributes if it's an element, no-op otherwise.
| | modifyChildren :: (c (n c tag text) -> c (n c tag text)) -> n c tag text -> n c tag text | Source |
| Modify children (non-recursively) if it's an element, no-op otherwise.
| | mapAllTags :: (tag -> tag') -> n c tag text -> n c tag' text | Source |
| Map all tags (both tag names and attribute names) recursively.
| | mapElement :: ((tag, [(tag, text)], c (n c tag text)) -> (tag', [(tag', text)], c (n c tag' text))) -> n c tag text -> n c tag' text | Source |
| Map an element non-recursively, allowing the tag type to be changed.
| | mapNodeContainer :: (c (n c tag text) -> ItemM c (c' (n c' tag text))) -> n c tag text -> ItemM c (n c' tag text) | Source |
| Change a node from one container type to another.
| | mkText :: text -> n c tag text | Source |
| Create a text node
|
| | Instances | |
|
|
|
A class of node types where an Element can be constructed given a tag,
attributes and children.
| | Methods | mkElement :: tag -> Attributes tag text -> c (n c tag text) -> n c tag text | Source |
|
| | Instances | |
|
|
|
Get the value of the attribute having the specified name.
|
|
|
Set the value of the attribute with the specified name to the value, overwriting
the first existing attribute with that name if present.
|
|
|
Delete the first attribute matching the specified name.
|
|
|
setAttribute if Just, deleteAttribute if Nothing.
|
|
Produced by Haddock version 2.6.1 |