; selects the fifth 'para' child of the context node that has a type ; attribute with value warning ; ; Abbreviated XPath: para[@type='warning'][5] ; Full XPath: child::para[attribute::type='warning'][position()=5] (define tree '(chapter (para "para1") (para (@ (type "warning")) "para 2") (para (@ (type "warning")) "para 3") (para (@ (type "warning")) "para 4") (para (@ (type "warning")) "para 5") (para (@ (type "warning")) "para 6")) ) ; Low-level: ((node-reduce (select-kids (ntype?? 'para)) (sxml:filter (node-join (select-kids (ntype?? '@)) (select-kids (node-equal? '(type "warning"))))) (node-pos 5)) tree) ; SXPath: ((sxpath `( (((para (@ (equal? (type "warning"))))) 5 ) )) tree) ==> ((para (@ (type "warning")) "para 6"))