[racket] sxpath, txpath

From: Sanjeev Sharma (throwit1 at gmail.com)
Date: Mon Feb 23 05:58:39 EST 2015

I'm somehow stuck on how to translate txpath syntax to sxpath syntax

#lang racket (require sxml)(require sxml/html)
(define doc(html->xexp"<AAA>

((txpath"/aaa/xxx/preceding::*")doc); expect bbb, ccc, zzz

I tried a bunch of variations  for sxpath:

((sxpath'(// ccc '(descendant-or-self )))doc)
((sxpath'(// ccc '(/ descendant-or-self )))doc)
((sxpath'(// ccc / descendant-or-self::*))doc)

"Like sxpath, but only accepts an XPath query in string form, using the
standard XPath syntax.

Deprecated; use sxpath instead."

I'd like to get the other axes and accessors working but now that I've
spent some time on this I REALLY want to know what my blind spot is here.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20150223/1bd09695/attachment.html>

Posted on the users mailing list.