; selects all 'td' elements that have an attribute align="right" ; ; Abbreviated XPath: //td[@align="right"] ; Full XPath: /descendant::td[attribute::align="right"] (define tree '(html (head (title "Slides")) (body (p (@ (align "center")) (table (@ (style "font-size: x-large")) (tr (td (@ (align "right")) "Talks ") (td (@ (align "center")) " = ") (td " slides + transition")) (tr (td) (td (@ (align "center")) " = ") (td " data + control")) (tr (td) (td (@ (align "center")) " = ") (td " programs")))) (ul (li (a (@ (href "slides/slide0001.gif")) "Introduction")) (li (a (@ (href "slides/slide0010.gif")) "Summary"))))) ) ; Low-level: ((node-reduce (node-closure (ntype?? 'td)) (sxml:filter (node-join (select-kids (ntype?? '@)) (select-kids (node-equal? '(align "right")))))) tree) ; SXPath: ((sxpath `(// (td (@ (equal? (align "right")))))) tree) ==> ((td (@ (align "right")) "Talks "))