GNU bug report logs -
#26533
26.0.50; xml-parse-region's symbol-qname argument is ignored
Previous Next
Full log
Message #13 received at 26533-done <at> debbugs.gnu.org (full text, mbox):
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 33 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.