unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Ricardo Wurmus <rekado@elephly.net>
To: swedebugia <swedebugia@riseup.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:41:32 +0100	[thread overview]
Message-ID: <87tvhz5nsz.fsf@elephly.net> (raw)
In-Reply-To: <42ab2c44-3e2f-d2ba-17de-3f73f78b148b@riseup.net>


swedebugia <swedebugia@riseup.net> writes:

> On 2019-01-23 16:58, Ricardo Wurmus wrote:
>>
>> swedebugia <swedebugia@riseup.net> writes:
>>
>>>> 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.
>>
>> I would recommend looking for a better source of package information.
>> Parsing HTML is not fun and is often brittle.
>
> I understand. Hm. Will try asking the author.
>
> Got a little further. Added this:
>
> (define (sanitize-html html)
>   "Correct an offending invalid line from the html source"
>   (let* ((html1 (regexp-substitute #f (string-match "main.css\">" html)
>                                    'pre "main.css\" />" 'post))
>          (result (regexp-substitute #f (string-match "utf-8\">" html1)
>                                     'pre "utf-8\" />" 'post)))
>     result))

It’s generally a bad idea to use regular expressions on HTML or XML.  Be
careful.

> sxml/simple.scm:143:4: In procedure loop:
> Throw to key `parser-error' with args `(#<input: string 24fdaf0>
> "[wf-entdeclared] broken for " copy)'.

I guess this is about the &copy; entity.  You may have to tell xml->sxml
about these HTML entities.

--
Ricardo

  reply	other threads:[~2019-01-23 16:41 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
2019-01-23 15:58     ` Ricardo Wurmus
2019-01-23 16:32       ` swedebugia
2019-01-23 16:41         ` Ricardo Wurmus [this message]
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=87tvhz5nsz.fsf@elephly.net \
    --to=rekado@elephly.net \
    --cc=guix-devel@gnu.org \
    --cc=swedebugia@riseup.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).