GNU bug report logs - #26533
26.0.50; xml-parse-region's symbol-qname argument is ignored

Previous Next

Package: emacs;

Reported by: Christopher Wellons <wellons <at> nullprogram.com>

Date: Sun, 16 Apr 2017 12:49:01 UTC

Severity: normal

Found in version 26.0.50

Done: David Engster <deng <at> randomsample.de>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Christopher Wellons <wellons <at> nullprogram.com>
To: David Engster <deng <at> randomsample.de>
Cc: 26533-done <at> debbugs.gnu.org
Subject: bug#26533: 26.0.50; xml-parse-region's symbol-qname argument is ignored
Date: Mon, 17 Apr 2017 12:29:15 -0400
Thanks, David! Your fix works fine as far as I can tell.

I'm using this trick in Elfeed (a syndication feed reader) as a fast
method to strip all namespaces from the XML as it's being parsed. As you
said, there's a lot of invalid XML in the wild. I've found it works a
lot better to ignore namespaces and strictness, instead extracting the
required information heuristically as long as it's reasonably close.
Otherwise there would be a whole lot more feeds that wouldn't work well,
or at all, in Elfeed.

I had noticed with symbol-qnames that xml-parse-region drops unknown
namespaces. Since this information comes from an alist, that seemed like
reasonable behavior and I assumed it was intentional -- though signaling
an error would also be reasonable. To tightly control which namespaces
are stripped, I bind xml-default-ns to my own alist for that call. This
feels like the natural and lispy way to use this function.

The file that binds xml-default-ns requires the xml package explicitly,
so there's no risk of it autoloading while it's bound. Though that's an
interesting consequence I hadn't considered before. I _have_ seen
similar issues with accept-process-output when arbitrary process events
are handled while the stack is in an unusual state.




This bug report was last modified 8 years and 34 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.