unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: swedebugia <swedebugia@riseup.net>
To: Ricardo Wurmus <rekado@elephly.net>
Cc: guix-devel <guix-devel@gnu.org>
Subject: Re: Help with sxml simple parser for the quicklisp importer
Date: Wed, 23 Jan 2019 17:03:02 +0100	[thread overview]
Message-ID: <a15124a8-1b06-77e7-8d35-4de4cee59afe@riseup.net> (raw)
In-Reply-To: <874l9z78sc.fsf@elephly.net>

On 2019-01-23 15:22, Ricardo Wurmus wrote:
> 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’t need to use “get-string-all”; “xml->sxml” 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 `(#<input: string 23c45b0>
>> "[GIMatch] broken for " (END . head) " while expecting " END link)'.
> 
> I fetched the document.  Here’s the part that it barfs on:
> 
> --8<---------------cut here---------------start------------->8---
> <!DOCTYPE html>
> <html>
> <head>
>    <meta charset="utf-8">
>    <title>1am | Quickdocs</title>
>    <link rel="stylesheet" type="text/css" href="/css/LigatureSymbols/style.css" />
>    
> <link rel="stylesheet" type="text/css" media="screen" href="/css/main.css">
> 
>    <script type="text/javascript" src="/js/jquery-1.9.1.min.js"></script>
>    <script type="text/javascript" src="/js/underscore-min.js"></script>
>    <script type="text/javascript" src="/js/quickdocs.js"></script>
> </head>
> …
> --8<---------------cut here---------------end--------------->8---
> 
> The second “link” tag opens but is never closed.  This may be valid
> HTML, but it is not valid XML, which is what xml->sxml expects.

Thanks for the quick answer!
I will try to remove this line before handling over to the parser.

-- 
Cheers Swedebugia

  reply	other threads:[~2019-01-23 15:55 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-23 12:35 Help with sxml simple parser for the quicklisp importer swedebugia
2019-01-23 14:22 ` Ricardo Wurmus
2019-01-23 16:03   ` swedebugia [this message]
2019-01-23 15:58     ` Ricardo Wurmus
2019-01-23 16:32       ` swedebugia
2019-01-23 16:41         ` Ricardo Wurmus
2019-01-23 18:58           ` Pierre Neidhardt
2019-01-23 21:21             ` swedebugia
2019-01-23 16:55       ` Katherine Cox-Buday

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a15124a8-1b06-77e7-8d35-4de4cee59afe@riseup.net \
    --to=swedebugia@riseup.net \
    --cc=guix-devel@gnu.org \
    --cc=rekado@elephly.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).