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>
   <BBB>
      <CCC/>
      <ZZZ/>
   </BBB>
   <XXX>
      <DDD>
           <EEE/>
           <FFF>
              <HHH/>
              <GGG>
                 <JJJ>
                    <QQQ/>
                 </JJJ>
                 <JJJ/>
              </GGG>
              <HHH/>
           </FFF>
      </DDD>
   </XXX>
   <CCC>abcdefg
      <DDD/>
   </CCC>
</AAA>"))

((txpath"/aaa/xxx/preceding::*")doc); expect bbb, ccc, zzz
((sxpath'(//ccc/descendant-or-self::*))doc)

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)

~/.racket/6.1.1/pkgs/sxml/sxml/doc/sxml/sxpath.html
"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.
____________________
  Racket Users list:
  http://lists.racket-lang.org/users

Reply via email to