emacs-devel
[Top][All Lists]
Advanced

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

XML and emacs (was Re: A new online publishing tool for Texinfo document


From: Nic Ferrier
Subject: XML and emacs (was Re: A new online publishing tool for Texinfo documents.)
Date: 24 Nov 2003 09:43:17 +0000

Juri Linkov <address@hidden> writes:

> Making some XML library available as part of Emacs might be useful.
> Current XML parsing implemented in Emacs Lisp is too slow on large
> XML files.  But maybe building a DOM tree from makeinfo XML output
> is not needed at all.  This might be needed for XML transformation,
> e.g. for reordering the Info nodes.  But for simple text formatting
> a simple sequential SAX-like processor should be enough.  It could
> provide, for instance, the following hooks:
> 
> (defun xml-start-element (name atts))
> 
> (defun xml-characters (str)
>   (insert str))
> 
> (defun xml-end-element (name from to)
>   ;; this could be used to format the inserted text
>   (cond ((equal name "para"))
>          (fill-region-as-paragraph from to)))

Yes. Or STaX which is a new API available only for Java right now and
looks like it's a  bit easier to deal with than SAX.

libxml2 does have a SAX implementation so if I make it part of Emacs
then that would be available.

James Clark and I have already had a discussion about this on the
emacs-devel list. James is writing an XML parser in Emacs Lisp and
his view was that native Elisp is always going to be better than a
foreign library.

I take his point. But there are other reasons why I'd like libxml2
integrated into Emacs (because I use it everywhere else other than
Emacs) so I might do it anyway.



Nic





reply via email to

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