| Safe Haskell | None | 
|---|---|
| Language | Haskell98 | 
Text.HTML.TagSoup.Tree.Selection
Description
Selecting subtrees from TagSoup TagTrees.
- selectGroup :: Matchable str => SelectorGroup -> TagTree str -> [[Maybe (TagTreePos str)]]
 - select :: Matchable str => Selector -> TagTree str -> [TagTreePos str]
 - selectAll :: Matchable str => [Selector] -> TagTree str -> [(TagTreePos str, [Bool])]
 - canMatch :: Matchable str => Selector -> TagTreePos str -> Bool
 - matchesWith :: Matchable str => AttributeOperator -> str -> str -> Bool
 
Documentation
selectGroup :: Matchable str => SelectorGroup -> TagTree str -> [[Maybe (TagTreePos str)]] Source #
Traverses a tree, collecting all subtree positions for which at least one matches on the
    given selector group. If at least one subtree matches, a list of the same length as the
    number of selectors in the given selector group is added to the result list. In order,
    a Nothing indicates no match and Just a match for the corresponding selector.
select :: Matchable str => Selector -> TagTree str -> [TagTreePos str] Source #
Traverses a tree, collecting all subtree positions which match on the given selector.
selectAll :: Matchable str => [Selector] -> TagTree str -> [(TagTreePos str, [Bool])] Source #
Traverses a tree, collecting all traversed positions in order. For each position all selectors are tried to be matched with the node at the current position and the information about whether a match is possible is added to the result list.
canMatch :: Matchable str => Selector -> TagTreePos str -> Bool Source #
Checks if a selector can be matched with the node at the given position.
matchesWith :: Matchable str => AttributeOperator -> str -> str -> Bool Source #
Checks if two string-like values match under the given attribute operator.