all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Lars Magne Ingebrigtsen <larsi@gnus.org>
To: emacs-devel@gnu.org
Subject: Re: Problems with xml-parse-string
Date: Wed, 22 Sep 2010 18:12:54 +0200	[thread overview]
Message-ID: <m3pqw5oiyh.fsf@quimbies.gnus.org> (raw)
In-Reply-To: 87bp7pkcho.fsf@stupidchicken.com

Chong Yidong <cyd@stupidchicken.com> writes:

> First let me clarify a technical detail.  In your new format,

[...]

> seems to assume that element names never start with the colon character.
> That is, there can never be an element named ":type".
>
> The XML spec (http://www.w3.org/TR/2008/REC-xml-20081126/) seems to
> indicate that element names are allowed to start with a colon; see the
> definition of NameStartChar in section 2.3.
>
> It looks like the new format would give ambiguous results in that case.

True.

Like I said, I only wanted it for the HTML case, and the XML case was
just an afterthought.  And in HTML, there can be no :tags.

Looking at the output from xml.el and xml.c on two RSS feeds, the format
doesn't seem to be the biggest change, but the actual data:

This is from the same RSS feed.  First the xml.el parser:

(pp xml (current-buffer))
((rdf:RDF
  ((xmlns:rdf . "http://www.w3.org/1999/02/22-rdf-syntax-ns#")
   (xmlns . "http://purl.org/rss/1.0/")
   (xmlns:taxo . "http://purl.org/rss/1.0/modules/taxonomy/")
   (xmlns:dc . "http://purl.org/dc/elements/1.1/")
   (xmlns:syn . "http://purl.org/rss/1.0/modules/syndication/")
   (xmlns:admin . "http://webns.net/mvcb/"))
  "\n  "
  (channel
   ((rdf:about . "http://blog.gmane.org/gmane.discuss"))
   "\n    "
   (title nil "gmane.discuss")
   "\n    "
   (link nil "http://blog.gmane.org/gmane.discuss")
   "\n    "
   (description nil
		(""))
   "\n    "
   (syn:updatePeriod nil "hourly")
   "\n    "
   (syn:updateFrequency nil "1")
   "\n    "
   (syn:updateBase nil "1901-01-01T00:00+00:00")
   "\n    "
   (items nil "\n      "
	  (rdf:Seq nil "\n        "
		   (rdf:li
		    ((rdf:resource . "http://permalink.gmane.org/gmane.discuss/13574"))
		    (""))
		   "\n        "
		   (rdf:li

Then the same thing from the xml.c parser:
                   
(pp nxml (current-buffer))
(RDF
 (text . "\n  ")
 (channel
  (:about . "http://blog.gmane.org/gmane.discuss")
  (text . "\n    ")
  (title
   (text . "gmane.discuss"))
  (text . "\n    ")
  (link
   (text . "http://blog.gmane.org/gmane.discuss"))
  (text . "\n    ")
  (description)
  (text . "\n    ")
  (updatePeriod
   (text . "hourly"))
  (text . "\n    ")
  (updateFrequency
   (text . "1"))
  (text . "\n    ")
  (updateBase
   (text . "1901-01-01T00:00+00:00"))
  (text . "\n    ")
  (items
   (text . "\n      ")
   (Seq
    (text . "\n        ")
    (li
     (:resource . "http://permalink.gmane.org/gmane.discuss/13574"))
    (text . "\n        ")
    (li

So more work is needed to turn the xml.c parser into something that's
compatible with what xml.el users expect.

Anyway, back to the format thing -- if we disregard the :tag issue
(i.e., find a work-around), then it would be pretty trivial to write a
function to convert the output from libxml-parse-xml-region into what
the xml.el package returns.  (Not to mention the nxml.el package, which
does the same as the xml.el package?)  It'd still be faster than the
pure Elisp version, and Gnus can call libxml-parse-html-region (as
planned) to render HTML as fast and convenient as possible.
    
-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@gnus.org * Lars Magne Ingebrigtsen




  reply	other threads:[~2010-09-22 16:12 UTC|newest]

Thread overview: 100+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-14 18:11 Problems with xml-parse-string Leo
2010-09-14 18:24 ` Lars Magne Ingebrigtsen
2010-09-14 21:18   ` Stefan Monnier
2010-09-15  8:06     ` Lars Magne Ingebrigtsen
2010-09-15  8:51       ` Stefan Monnier
2010-09-15  9:21         ` Lars Magne Ingebrigtsen
2010-09-15  9:54           ` Leo
2010-09-15 10:16             ` Julien Danjou
2010-09-15 15:58               ` Chad Brown
2010-09-21 23:00           ` Chong Yidong
2010-09-21 23:24             ` Leo
2010-09-22  2:26               ` Chong Yidong
2010-09-22  3:15                 ` Chong Yidong
2010-09-22  7:14                   ` Stefan Monnier
2010-09-22 10:35                   ` Lars Magne Ingebrigtsen
2010-09-22 10:58                     ` Lars Magne Ingebrigtsen
2010-09-22 11:00                     ` Leo
2010-09-22 11:09                       ` Lars Magne Ingebrigtsen
2010-09-22 11:41                         ` Lars Magne Ingebrigtsen
2010-09-22 11:55                           ` Wojciech Meyer
2010-09-22 12:09                             ` Lars Magne Ingebrigtsen
2010-09-22 12:17                               ` Wojciech Meyer
2010-09-22 12:18                                 ` Lars Magne Ingebrigtsen
2010-09-22 12:20                                   ` Wojciech Meyer
2010-09-22 12:26                                     ` Lars Magne Ingebrigtsen
2010-09-22 12:34                                       ` Wojciech Meyer
2010-09-22 12:46                                         ` Lars Magne Ingebrigtsen
2010-09-22 12:45                         ` Leo
2010-09-22 13:14                           ` Lars Magne Ingebrigtsen
2010-09-22 14:07                             ` Chong Yidong
2010-09-22 15:04                               ` Eli Zaretskii
2010-09-22 23:59                               ` Stefan Monnier
2010-09-23  5:53                                 ` Leo
2010-09-23 15:43                                   ` Chong Yidong
2010-09-23 16:53                                     ` Leo
2010-09-23 21:58                                     ` Wojciech Meyer
2010-09-23 22:21                                     ` Lars Magne Ingebrigtsen
2010-09-24  0:04                                       ` Stefan Monnier
2010-09-24  0:06                                         ` Lars Magne Ingebrigtsen
2010-09-24  1:09                                           ` Chong Yidong
2010-09-24  2:46                                             ` David De La Harpe Golden
2010-09-24  5:38                                               ` David Kastrup
2010-09-24  8:02                                               ` Eli Zaretskii
2010-09-24 10:47                                                 ` Wojciech Meyer
2010-09-24 10:44                                             ` Wojciech Meyer
2010-09-24 10:49                                             ` Lars Magne Ingebrigtsen
2010-09-24 15:25                                               ` Chong Yidong
2010-09-24 15:53                                                 ` Lars Magne Ingebrigtsen
2010-09-24 16:26                                                   ` Chong Yidong
2010-09-24 16:46                                                     ` Lars Magne Ingebrigtsen
2010-09-24 17:34                                                       ` Wojciech Meyer
2010-09-24 18:09                                                         ` Frank Schmitt
2010-09-24 18:21                                                           ` Ted Zlatanov
2010-09-24 18:31                                                           ` Wojciech Meyer
2010-09-24 18:47                                                       ` Chong Yidong
2010-09-24 18:53                                                         ` Chong Yidong
2010-09-24 18:58                                                           ` Wojciech Meyer
2010-09-24 19:06                                                         ` Lars Magne Ingebrigtsen
2010-09-24 19:25                                                           ` Chong Yidong
2010-09-24 19:34                                                             ` Lars Magne Ingebrigtsen
2010-09-24 21:57                                                               ` Chong Yidong
2010-09-25 13:11                                                                 ` Lars Magne Ingebrigtsen
2010-09-25 13:31                                                                   ` Eli Zaretskii
2010-09-25 13:56                                                                     ` David Kastrup
2010-09-25 13:59                                                                     ` Wojciech Meyer
2010-09-25 16:13                                                                       ` Eli Zaretskii
2010-09-25 16:46                                                                         ` Wojciech Meyer
2010-09-25 22:29                                                                           ` Juanma Barranquero
2010-09-25 15:00                                                                     ` Chong Yidong
2010-09-24 22:01                                                             ` Stefan Monnier
2010-09-24 22:17                                                               ` Chong Yidong
2010-09-25  0:25                                                                 ` Wojciech Meyer
2010-09-25 14:42                                                       ` Andy Wingo
2010-09-25 15:12                                                         ` Leo
2010-09-25 15:21                                                         ` Leo
2010-09-25 15:42                                                           ` Wojciech Meyer
2010-09-25 20:02                                                             ` Stefan Monnier
2010-09-25 20:32                                                               ` Leo
2010-09-25 23:08                                                               ` Leo
2010-09-26 21:55                                                                 ` Stefan Monnier
2010-09-26 23:34                                                                   ` Leo
2010-09-26  3:48                                                               ` pcase.el (was: Problems with xml-parse-string) Ted Zlatanov
2010-09-26 22:06                                                                 ` pcase.el Stefan Monnier
2010-09-27 16:59                                                                   ` pcase.el Leo
2010-09-27 22:51                                                                     ` pcase.el Stefan Monnier
2010-09-28 18:17                                                                   ` pcase.el Ted Zlatanov
2010-09-24 23:43                                         ` Problems with xml-parse-string Andrew W. Nosenko
2010-09-23  2:16                               ` Kevin Rodgers
2010-09-22 14:05                     ` Chong Yidong
2010-09-22 14:32                       ` Lars Magne Ingebrigtsen
2010-09-22 15:46                         ` Chong Yidong
2010-09-22 16:12                           ` Lars Magne Ingebrigtsen [this message]
2010-09-22 16:51                           ` Wojciech Meyer
2010-09-22 18:06                             ` Chong Yidong
2010-09-22 18:14                               ` Edward O'Connor
2010-09-22 18:34                                 ` Leo
2010-09-22 18:41                                   ` Chong Yidong
2010-09-22 19:57                                     ` Wojciech Meyer
2010-09-22 18:06                             ` Andy Wingo
2010-09-22 23:48             ` Stefan Monnier

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

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

  git send-email \
    --in-reply-to=m3pqw5oiyh.fsf@quimbies.gnus.org \
    --to=larsi@gnus.org \
    --cc=emacs-devel@gnu.org \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.