> On May 13, 2018, at 21:55, N. Raghavendra <nyraghu27...@gmail.com> wrote: > > At 2018-05-14T00:33:45-04:00, John Clements wrote: > >> It turns out that the “sxml:document” function looks for local files >> *without* a file: prefix. So, you can just call >> >> (sxml:docmuent “/tmp/test.xml”) > > Thanks for your help. The above is not working for me:
Actually, that’s good news. Since the existing code was completely broken, I don’t need to worry that I’m making any existing users unhappy by enforcing the “file://“ prefix. I’ve made a change that appears to allow the use of “file://“ URIs with sxml:document, and added a bit of clarifying documentation; the updated package should be picked up by the package server in less than a day, unless there’s a build error (entirely possible). Thanks again for your report! John > > ---------- >> (sxml:document "/tmp/test.xml") > open-input-resource: /tmp/test.xml: Missing protocol (usually "http:") at the > beginning of URL: /tmp/test.xml > peek-char: contract violation > expected: input-port? > given: #f > context...: > /home/raghu/.racket/6.12/pkgs/sxml/sxml/ssax/input-parse.rkt:94:0: > skip-while > /home/raghu/.racket/6.12/pkgs/sxml/sxml/ssax/SSAX-code.rkt:1150:0: > ssax:scan-Misc > /home/raghu/.racket/6.12/pkgs/sxml/sxml/ssax/SSAX-code.rkt:1657:5: > scan-for-significant-prolog-token-1 > /home/raghu/.racket/6.12/pkgs/sxml/sxml/ssax/SSAX-code.rkt:1879:0: > ssax:xml->sxml > /home/raghu/.racket/6.12/pkgs/sxml/sxml/xpath-context_xlink.rkt:2752:0: > sxml:document > /usr/share/racket/collects/racket/private/misc.rkt:88:7 >> > ---------- > >> I usually just use "ssax:xml->sxml” instead, which will also work for >> you. > > Yes, it does: > > ---------- >> (call-with-input-file "/tmp/test.xml" > (lambda (in) > (ssax:xml->sxml in '()))) > > '(*TOP* > (*PI* xml "version=\"1.0\" encoding=\"utf-8\"") > (http://www.w3.org/1999/xhtml:html ... >> > ---------- > > Raghu. > > -- > N. Raghavendra <ra...@hri.res.in>, http://www.retrotexts.net/ > Harish-Chandra Research Institute, http://www.hri.res.in/ > > -- > You received this message because you are subscribed to the Google Groups > "Racket Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to racket-users+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.