[plt-scheme] XML ease of use

From: Eddie Sullivan (eddieSull at hotmail.com)
Date: Tue Aug 4 18:47:45 EDT 2009

It turns out read-html-as-xml was returning something like (list #<pcdata> 
#<element> #<pcdata>), where the two pcdatas are whitespace and the element 
is an HTML element. I was able to write a simple function to go through and 
find the HTML element and call xml->xexpr on that. That seems a reasonable 
approach, assuming the HTML file is at least somewhat well-formed (which in 
my case I can).
Thanks again.

----- Original Message ----- 
From: "Jay McCarthy" <jay.mccarthy at gmail.com>

>I think I would do
> `(html ,@(map content->xexpr (read-html-as-xml)))
> where content->xexpr was the right stuff using xml->xexpr.
> Jay
> On Tue, Aug 4, 2009 at 3:40 PM, Eddie Sullivan<eddieSull at hotmail.com> 
> wrote:
>> Sorry, one last question.
>> I see that read-html-as-xml returns a (listof content/c). I would have
>> expected this to return a document object. What is the best way to turn 
>> this
>> returned value into an xexpr?
>> Thanks.
>> -Eddie
> -- 
> Jay McCarthy <jay at cs.byu.edu>
> Assistant Professor / Brigham Young University
> http://teammccarthy.org/jay
> "The glory of God is Intelligence" - D&C 93

Posted on the users mailing list.