From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ricardo Wurmus Subject: Re: Help with sxml simple parser for the quicklisp importer Date: Wed, 23 Jan 2019 15:22:59 +0100 Message-ID: <874l9z78sc.fsf@elephly.net> References: <1b161633-c285-1401-d771-c965dae58149@riseup.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([209.51.188.92]:44662) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gmJfq-0001oY-8e for guix-devel@gnu.org; Wed, 23 Jan 2019 09:38:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gmJfo-0003uC-2K for guix-devel@gnu.org; Wed, 23 Jan 2019 09:38:38 -0500 Received: from sender-of-o53.zoho.com ([135.84.80.218]:21822) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gmJfk-0003qA-Sf for guix-devel@gnu.org; Wed, 23 Jan 2019 09:38:34 -0500 In-reply-to: <1b161633-c285-1401-d771-c965dae58149@riseup.net> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: swedebugia Cc: guix-devel Hi, > (define (get-homepage name) > "Get the latest meta release file. From the links in this we extract all > other information we need." > (call-with-temporary-output-file > (lambda (temp port) > (and (url-fetch (homepage name) temp) > (xml->sxml (get-string-all port)))))) Aside: you don=E2=80=99t need to use =E2=80=9Cget-string-all=E2=80=9D; =E2= =80=9Cxml->sxml=E2=80=9D can read directly from a port. > But it errors out with: > > sxml/simple.scm:143:4: In procedure loop: > Throw to key `parser-error' with args `(# > "[GIMatch] broken for " (END . head) " while expecting " END link)'. I fetched the document. Here=E2=80=99s the part that it barfs on: --8<---------------cut here---------------start------------->8--- 1am | Quickdocs =20=20 =E2=80=A6 --8<---------------cut here---------------end--------------->8--- The second =E2=80=9Clink=E2=80=9D tag opens but is never closed. This may = be valid HTML, but it is not valid XML, which is what xml->sxml expects. -- Ricardo