[plt-scheme] sxml.ss - Works on its own, but not in module

From: Eric Biunno (01rice at gmail.com)
Date: Mon Jan 14 18:08:47 EST 2008

I might have spoken too soon, this doesn't seem to work:

(module foo mzscheme
  (require (planet "sxml.ss" ("lizorkin" "sxml.plt" 1 4)))

(define test
  (apply
   string-append
   (sxml:clean-feed
    (stx:transform-dynamic
     (sxml:add-parents
      (sxml:document "http://modis.ispras.ru/Lizorkin/XML/poem.xml"))
     (stx:make-stx-stylesheet
      (sxml:document
       "http://modis.ispras.ru/Lizorkin/XML/poem2html.xsl"
       '((xsl . "http://www.w3.org/1999/XSL/Transform"))))))) ;originaly had
a leading space " http://www.w3.org/1999/XSL/Transform"
  )

(provide test))


(module foo-user mzscheme
  (require (file "foo.ss"))

  (display test)
  )




On Jan 13, 2008 5:41 PM, John Clements <clements at brinckerhoff.org> wrote:

>
> On Jan 12, 2008, at 8:20 PM, Eric Biunno wrote:
>
> > Hi, I'm a little confused. The following code works as expected:
> >
> > (require (planet "sxml.ss" ("lizorkin" "sxml.plt" 1 4)))
> >
> >   (define test
> >     (apply
> >  string-append
> >  (sxml:clean-feed
> >    (stx:transform-dynamic
> >      (sxml:add-parents
> >       (sxml:document "http://modis.ispras.ru/Lizorkin/XML/poem.xml"))
> >      (stx:make-stx-stylesheet
> >        (sxml:document
> >          "http://modis.ispras.ru/Lizorkin/XML/poem2html.xsl"
> >          '((xsl . " http://www.w3.org/1999/XSL/Transform")))))))
> >    )
> >
> > (test)
> >
> > But when I create a module with this code and then call (test) from
> > another file I get the following error:
> > .plt-scheme/planet/300/371/cache/lizorkin/sxml.plt/1/4/stx-
> > engine.ss::12970: reference to undefined identifier: sxpath
>
> Something's not right, here.
>
> 1) The code you've supplied will not evaluate in the MzScheme
> language, because 'test' is bound to a string, and not to a procedure.
> 2) When I remove the parens around 'test', this code works fine and
> displays the expected string.
> 3) When I wrap it in a module and evaluate it, 'test' is again bound
> to the correct value.
> 4) When I require this module from another one and fetch the value of
> 'test', I again get the right value.
>
> Here's the module that I generated:
>
> (module foo mzscheme
>   (require (planet "sxml.ss" ("lizorkin" "sxml.plt" 1 4)))
>
> (define test
>   (apply
>    string-append
>    (sxml:clean-feed
>     (stx:transform-dynamic
>      (sxml:add-parents
>       (sxml:document "http://modis.ispras.ru/Lizorkin/XML/poem.xml"))
>      (stx:make-stx-stylesheet
>       (sxml:document
>        "http://modis.ispras.ru/Lizorkin/XML/poem2html.xsl"
>        '((xsl . " http://www.w3.org/1999/XSL/Transform")))))))
>   )
>
> (provide test))
>
>
> (module foo-user mzscheme
>   (require (file "foo.ss"))
>
>   (display test)
>   )
>
> John Clements
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20080114/9d40c9cf/attachment.html>

Posted on the users mailing list.