all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* More XML Parsing: Is anyone using CVS xml.el namespace processing?
@ 2003-09-28 17:31 Mark A. Hershberger
  2003-09-29 19:32 ` Richard Stallman
  0 siblings, 1 reply; 2+ messages in thread
From: Mark A. Hershberger @ 2003-09-28 17:31 UTC (permalink / raw)



Recently I had a short conversation with James Clark about the
structures xml.el produces.

I asked him what he thought about the current (CVS) namespace-aware
processing.  Based on his feedback, I plan to submit changes that
will return an incompatible structure to the one currently in CVS.

Currently, when xml.el encounters a bit of XML like:

    <ns:xml xmlns:ns="uri:namespace" ns:attr="value"/>

it produces:

    (({uri:namespace}xml 
     (({http://www\.w3\.org/2000/xmlns/}ns . "uri:namespace") 
      ({uri:namespace}attr . "value"))))

At the time that I wrote this, I saw some W3 docs where this style was
used and copied it.  Some people here asked me why I did this instead
of something like (uri:namespace . "xml"), but I forged ahead.

Now, after my conversation with Mr. Clark, I've been persuaded that I
was wrong.  At his suggestion, I'd like to change the above xml
representation produce the following:

    (((uri:namespace . "xml")
     ((((http://www\.w3\.org/2000/xmlns/ . "ns") . "uri:namespace") 
      ((uri:namespace . "attr") . "value")))))

As Mr. Clark said:

    ... there are typically not very many different namespace URIs, so
    keeping them in Emacs symbol table is not a problem; in the
    returned representation of the XML, the namespaces would be
    shared, but strings are mutable in Emacs, which is kind of ugly.

Where there is no namespace given:

    <xml attr="value">

It would produce the following:

    (("xml"
      (("attr" . "value"))))

Unless there are major objections, I'd like to repent of my previous
code and submit changes to produce the above.

Mark.

-- 
If you want to know who is funding terrorists, look in the vanity
mirror as you turn the key of your SUV.
    -- http://philip.greenspun.com/politics/israel/

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: More XML Parsing: Is anyone using CVS xml.el namespace processing?
  2003-09-28 17:31 More XML Parsing: Is anyone using CVS xml.el namespace processing? Mark A. Hershberger
@ 2003-09-29 19:32 ` Richard Stallman
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Stallman @ 2003-09-29 19:32 UTC (permalink / raw)
  Cc: bug-gnu-emacs

    Now, after my conversation with Mr. Clark, I've been persuaded that I
    was wrong.  At his suggestion, I'd like to change the above xml
    representation produce the following:

	(((uri:namespace . "xml")
	 ((((http://www\.w3\.org/2000/xmlns/ . "ns") . "uri:namespace") 
	  ((uri:namespace . "attr") . "value")))))

This seems a lot cleaner to me, in Lisp terms, than the current
behavior.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-09-29 19:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-09-28 17:31 More XML Parsing: Is anyone using CVS xml.el namespace processing? Mark A. Hershberger
2003-09-29 19:32 ` Richard Stallman

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.