From: ·········@yahoo.com
Subject: Parsing/Generating HTML...
Date: 
Message-ID: <1129739340.679609.233710@g47g2000cwa.googlegroups.com>
I am trying to combine net.html.parser:parse-html from pxmlutils and
net.html.generator:html-print from htmlgen packages. What I am trying
to do is get some html data, collect some specific tags from it and
then splice the html generated from the list into some other html file.
The error that I get is like the following (I simplified the example
but the essence is the same):
GETF: the property list #1=(:DIV :CLASS "sometext") has an odd length
   [Condition of type SIMPLE-TYPE-ERROR]

It happens when html-print tries to generate html from a constuct like
(:DIV :CLASS "sometext") which calls (getf '(:DIV :CLASS "sometext")
:CLASS) and that fails.

I wonder if I should use different packages for
parse-to-s-expr/from-s-expr-to-html (will lml or htout work here?) or
is it the lisp implementation specific problem?
I use CLisp 2.35 on Windows.

Thank you,
Andrei

From: Edi Weitz
Subject: Re: Parsing/Generating HTML...
Date: 
Message-ID: <uk6g93162.fsf@agharta.de>
On 19 Oct 2005 09:29:00 -0700, ·········@yahoo.com wrote:

> I am trying to combine net.html.parser:parse-html from pxmlutils and
> net.html.generator:html-print from htmlgen packages. What I am
> trying to do is get some html data, collect some specific tags from
> it and then splice the html generated from the list into some other
> html file.  The error that I get is like the following (I simplified
> the example but the essence is the same):
> GETF: the property list #1=(:DIV :CLASS "sometext") has an odd length
>    [Condition of type SIMPLE-TYPE-ERROR]
>
> It happens when html-print tries to generate html from a constuct
> like (:DIV :CLASS "sometext") which calls (getf '(:DIV :CLASS
> "sometext") :CLASS) and that fails.

Are you really trying to print something like

  (:div :class "sometext")?

It should be rather like

  ((:div :class "someclass") "sometext").

Cheers,
Edi.

-- 

Lisp is not dead, it just smells funny.

Real email: (replace (subseq ·········@agharta.de" 5) "edi")
From: ·········@yahoo.com
Subject: Re: Parsing/Generating HTML...
Date: 
Message-ID: <1129743751.213455.261290@g14g2000cwa.googlegroups.com>
It's what html-print complains about given some part of the output of
parse-html. I don't generate html content myself, I just get some file
on the Web and try to extract some info from it using the mentioned
utilities. With this (:div :class "text") example I am just trying to
show the root cause of what breaks the html-print.
This s-expr is constructed from html like:
<DIV CLASS="sometext">Some other text</DIV>
From: Edi Weitz
Subject: Re: Parsing/Generating HTML...
Date: 
Message-ID: <ufyqx2xv7.fsf@agharta.de>
[Please provide some context when replying.]

On 19 Oct 2005 10:42:31 -0700, ·········@yahoo.com wrote:

> It's what html-print complains about given some part of the output
> of parse-html. I don't generate html content myself, I just get some
> file on the Web and try to extract some info from it using the
> mentioned utilities. With this (:div :class "text") example I am
> just trying to show the root cause of what breaks the html-print.
> This s-expr is constructed from html like:
> <DIV CLASS="sometext">Some other text</DIV>

With AllegroCL this works fine:

  CL-USER> (net.html.parser:parse-html "<DIV CLASS=\"sometext\">Some other text</DIV>")
  (((:DIV :CLASS "sometext") "Some other text"))
  CL-USER> (net.html.generator:html-print (first *) *standard-output*)
  <DIV CLASS="sometext">Some other text</DIV>
  NIL

So maybe it's a problem in the ported libs you're using.  Do you have
a chance to try this with some other Lisp?

Cheers,
Edi.

-- 

Lisp is not dead, it just smells funny.

Real email: (replace (subseq ·········@agharta.de" 5) "edi")
From: ·········@yahoo.com
Subject: Re: Parsing/Generating HTML...
Date: 
Message-ID: <1129761437.819346.106390@z14g2000cwz.googlegroups.com>
Thanks Edi!

The problem was that I passed the extra parenthesis to html-print so
that when I started to pass the car of the list things started to work.
I wonder how it managed to swallow some other stuff even with extra
parenthesis around the s-expr html so it broke only after processing a
few html pages.