chickadee » sxpath » ntype??

ntype?? critprocedure

Takes a type criterion and returns a function, which, when applied to a node, will tell if the node satisfies the test.

 ntype?? :: Crit -> Node -> Boolean

The criterion crit is one of the following symbols:

@
tests if the Node is an attributes-list
*
tests if the Node is an Element
*text*
tests if the Node is a text node
*data*
tests if the Node is a data node (text, number, boolean, etc., but not pair)
*PI*
tests if the Node is a processing instructions node
*COMMENT*
tests if the Node is a comment node
*ENTITY*
tests if the Node is an entity node
*any*
#t for any type of Node
other symbol
tests if the Node has the right name given by the symbol
((ntype?? 'div) '(div (@ (class "greeting")) "hi"))
 => #t

((ntype?? 'div) '(span (@ (class "greeting")) "hi"))
 => #f

((ntype?? '*) '(span (@ (class "greeting")) "hi"))
 => #t