[plt-scheme] Re: comments in xexpr - how to preserve?

From: Benjamin Simon (ben at amazingmedia.com)
Date: Thu Aug 7 17:30:32 EDT 2003

>>>>> "KL" == Kirill Lisovsky <lisovsky at acm.org> writes:

 KL> Hello!
 KL> On 6 Aug 2003, Benjamin Simon wrote:

 >> 
 >> Now I've got to figure out this sxpath stuff.  I can't seem to get
 >> either implementations at [1] or [2] to work.  Though I think it is just
 >> because I haven't quite struggled enough with it yet.  I'll have to poke
 >> around the ssax mailing list as you suggest.
 >> 
 >> [1] - http://www196.pair.com/lisovsky/sxml/

 KL> .plt packages are available:
 KL> http://pair.com/lisovsky/download/sxml-tools/plt/

Thanks for the tip!

[sorry if this is getting off topic -- I know this may not be a plt
specific problem]

After much struggling I got sxpath and txpath to work. It turns out I
was doing something like:

  (define doc '(html (body (h1 "MY Header"))))
  ((sxpath '(// html body)) doc) 
   =>
  '()

instead of returning (html ...) as I would have expected.

It turns out that I had an off-by-one error and should have been doing:
  (define doc '(html (body (h1 "MY Header"))))
  ((sxpath '(// body)) doc) 
   =>
  '((body ...))

So I thought things were broken, when it was just me tripping over
myself.

Also, I couldn't find an implementation of Oleg's pre-post-order
function, so I just quickly ported it plt-scheme.  I don't quite
understand how what is included in the above .plt's is supposed to allow
you to do XSLT like translations -- but again, that may me just me not
having this stuff figured out yet.  Oh well, I'll keep plugging away.

Thanks,
Ben


-- 
Ben Simon                                     Amazing Media, Inc.
(703) 234-5342 (work)                       (703) 937-7779 (cell)


Posted on the users mailing list.