[plt-scheme] reading HTML as XML

From: Prabhakar Ragde (plragde at uwaterloo.ca)
Date: Fri Dec 12 09:48:59 EST 2008

Am I misreading the documentation somehow?

(require html)
(require net/url)
(require xml/xml)

(xml->xexpr
   (read-html-as-xml
     (get-pure-port (string->url "http://www.nytimes.com"))))

gets me something where the elements are not (list symbol ...), but 
element structures, all the way down. This doesn't seem to me to conform 
to the description of xexprs given in the XML Parsing and Writing 
library documentation. Sure, I can unwrap the element structures 
recursively, but it seems to me that xml->xexpr is supposed to do that. 
Thanks. --PR


Posted on the users mailing list.