emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Refactoring xml.el namespace handling


From: Stefan Monnier
Subject: Re: Refactoring xml.el namespace handling
Date: 04 Mar 2004 12:50:18 -0500
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

> Now that I've gotten a good HEAD, here is a fresh diff.

Thank you.  Here is a counter patch.  The main difference is that it uses
'http://foo/bar rather than :http://foo/bar so as to avoid an unnecessary
(concat ":" foo) and also so that (symbol-name foo) immediately returns
a usable URL.
It also cleans up a few elisp things (like replace mapcar->mapc->dolist,
and (append (list x) y) -> (cons x y), ...).
Things left:
- it seems that the new code returns either a TAG (a symbol) or (NS . TAG)
  where TAG is a string rather than a symbol.  Do I understand this right?
  Is that done on purpose?  It looks like a bad idea.
- in xml-parse-tag, you do

   (let (.. (children (list A B)) ...)
     ... (car children) ... (setcdr children ...) ...

  it would be better to do something slightly different so you don't need
  to extract the car of what you just built and you don't need to setcdr.
  Maybe something like

    (let (... (a A) (b B) ...)
      ... a ... (let ((children (list a (.. b ..)))) ...))

> 2004-03-03  Mark A. Hershberger  <address@hidden>
>
>       * xml.el (xml-maybe-do-ns): new function to handle namespace
>       parsing of both attribute and element names.
>       (xml-ns-parse-ns-attrs, xml-ns-expand-el, xml-ns-expand-attr,
>       xml-intern-attrlist): Removed in favor of xml-maybe-do-ns to avoid
>       un-necessary intern-ing.
>       (xml-parse-tag): Updated assumed namespaces.  Cleaned up namespace
>       parsing.
>       (xml-parse-attlist): Now does its own namespace parsing work.
>       (xml-parse-dtd): Updated <!ELEMENT parsing to accept elements with
>       hyphens.  Now skips ENTITY, ATTLIST, and NOTATION instead of
>       barfing.

ChangeLog text should use the present tense: it makes it easier to
write/read.


        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]