I have not been able to get those axes working either. I've looked
briefly at the implementation of `sxml:preceding`, and it's unclear to
me how it could even work.

Since `txpath` appears to work, I'd stick with that. I'm not sure why
it's deprecated in favor of `sxpath`. Since, AFAICT, we're just
packaging that library (i.e. not developing it) and its development
appears to have stopped, I don't expect `txpath` to go anywhere.

Vincent



At Tue, 3 Mar 2015 06:56:34 -0500,
Sanjeev K Sharma wrote:
> 
> On Mon, Mar 02, 2015 at 09:52:53AM -0500, Vincent St-Amour wrote:
> > I recommend the short tutorial near the top of this document:
> > 
> >     http://pkg-build.racket-lang.org/doc/sxml/sxpath.html
> >
> 
> Thanks for the suggested solution;
> 
> that was exactly the document I referred to 
> 
> I have not been able to generate an sxpath working example of the axes listed 
> at the bottom of that page.  Aside from generating an example, from Oleg's 
> documents to some other google hits I haven't found working examples either.
> 
> a simplified example (including your suggestion)
> 
> #lang racket (require sxml)(require sxml/html)
> (define doc(html->xexp
> "<AAA>
>    <BBB>
>       <CCC/>
>       <www> www content <xxx/><www>
>       <zzz/>
>    </BBB>
>    <XXX>
>       <DDD> content in ccc 
>       </DDD>
>    </XXX>
> </AAA>"))
> 
> ((txpath"/aaa/xxx/preceding::ccc")doc)
> ;  '((ccc))
> 
> 
> ((txpath"/aaa/xxx/preceding::www")doc)
> ;  '((www "\n" "      " (zzz) "\n" "   ")
> ;    (www
> ;     " www content "
> ;     (xxx)
> ;     (www "\n" "      " (zzz) "\n" "   ")))
> ;  '()
> 
> ((sxpath '(aaa xxx (sxml:preceding '(www)))) doc)
> ;  '()
>   
> ((sxpath '(aaa xxx (sxml:preceding (www)))) doc)
> ;  '()
> 
> ((sxpath'(aaa xxx (preceding:"www")))doc)
> ;  '()
> 
> ((sxpath '(aaa xxx ((sxml::preceding "www")))) doc)
> ;  '()
> 
> ((sxml:preceding ((sxpath '(aaa xxx www))))doc)
> ;  '()
> ____________________
>   Racket Users list:
>   http://lists.racket-lang.org/users
____________________
  Racket Users list:
  http://lists.racket-lang.org/users

Reply via email to