; selects all 'td' elements that have an attribute 'align' ; ; Abbreviated XPath: //td[@align] ; Full XPath: /descendant::td[attribute::align] (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 (ntype?? 'align))))) tree) ; SXPath: ((sxpath `(// (td (@ align)))) tree) ; SXPath: ((sxpath `(// ((td) (@ align)))) tree) ==> ((td (@ (align "right")) "Talks ") (td (@ (align "center")) " = ") (td (@ (align "center")) " = ") (td (@ (align "center")) " = "))