From: "Drew Adams" <drew.adams@oracle.com>
To: <emacs-devel@gnu.org>
Subject: XML editing wishlist (was: Saving markup formats)
Date: Sun, 17 Jun 2007 17:30:40 -0700 [thread overview]
Message-ID: <EIENLHALHGIMHGDOLMIMCEKLDCAA.drew.adams@oracle.com> (raw)
In-Reply-To: <87sl8qnrme.fsf@kanga.tapsellferrier.co.uk>
Some thoughts on Emacs support for editing XML...
I use nxml mode now when I edit XML with Emacs 22. I use SGML mode for that
when I use Emacs 20 (which is still most of the time ;-)). I'm not very
familiar with either mode, sad to say. So please ignore or forgive (and
correct) any misconceptions about them that I might demonstrate.
I edit XML code quite often, in spite of not having taken the time to check
out nxml mode well. Sometimes the XML I edit is within SQL or PL/SQL code,
as an argument to a SQL function. Similarly, I use XQuery and XPath
expressions quite often - likewise, within calls to SQL functions such as
XMLQuery and XMLTable. I really should try a multi-mode approach such as mmm
or mumamo, no doubt, but I haven't had time to do that yet either - I just
use SQL mode.
I know that there is an XQuery Emacs mode that exists. I downloaded it, but
I haven't yet tried it. I see zero commentary in the file and I haven't
found any Info file for it.
I often use XML Schema - that is, most of the XML I use is XML Schema-based.
I do not use any other type of schema for XML, except sometimes DTDs. In
particular, I don't use Relax NG. In the database world, it's all about XML
Schema and XQuery - and becoming more so (no flames, please).
I would love to see a really handy XML editing mode. I don't claim it
doesn't exist, but I haven't yet noticed some things I'd like to see. `C-h
m' in nXML mode gives only a cursory description, the XML menu-bar menu
seems quite sparse, there are no contextual pop-up menus (that I have
noticed), and the nXML Info manual (which I have only skimmed) seems also
quite skimpy. In short, where's the beef? ;-)
XML is huge. It is an ugly cousin of Lisp, in some ways. We really should
have something more to offer the _many_ different kinds of XML users, IMO.
Again, maybe we do, and I'm just unaware of it.
FWIW, I also use Framemaker, for work, and it is a surprisingly good WYSIWYG
round-trip editor for XML documents. It has great search and replace for XML
elements and attributes, and good visualization and manipulation of XML
structure (it's easy to change the structure interactively and not get lost
in what you're doing). It also has a good validation interface, but it is
limited to DTDs (or to simple XML Schemas that are limited to what DTDs can
do).
Some things I'd like to see in Emacs for XML (they might be there, but I
haven't noticed):
1. Double-click the mouse on `<' or `>' to pick up a complete sexp, just as
in Lisp. Or, better, double-click to pick up a complete tag and triple-click
to pick up the complete element. Currently, as soon as there is any
whitespace (e.g. there is an attribute), the complete tag is not selected.
Double-click, then right-click to extend to the next element boundary (or
something more significant than just a word). Other mouse selection
possibilities could also be useful. The mouse now seems almost useless for
XML.
2. XPath navigation.
3. XQuery navigation.
4. XML Schema support.
5. XML-specific search capabilities, even unrelated to XPath and XQuery:
search (and replace) for elements with certain attribute values etc. - at
least as good as what Framemaker has.
You can imagine different things for #2 and #3, from adding, deleting, and
selecting nodes to constructing more XML data using XQuery. Really, the
possibilities are limitless. I'd like the editor to let me use XQuery and
XPath to edit XML. I'd also like editor support for XQuery code itself; that
is, for editing XQuery and XPath expressions. Neither is XML (unlike XSLT).
XPath and XQuery (which includes XPath) are the natural matching languages
for XML. Regular expressions are completely general; they cannot take
advantage of anything defined in the XML language.
I've thought about adding something for #2 and #3 to Icicles, and I might
yet do so when I get some time. The idea would be to type an XPath or XQuery
expression as minibuffer input and have all of the matching nodes become
completion candidates (yes, whole nodes). More precisely, the result of an
XQuery expression is a sequence of items, which can be atoms or nodes. The
sequence would be used as the completion candidates set.
Different commands would do different things with those candidates. I would
use an Icicles search command to navigate among them. I would use another
command to select one or more, or transform one or more. And so on. IOW, use
XML-aware matching instead of regexp matching.
For that, I would add a different kind of completion to Icicles, in addition
to prefix completion and apropos (regexp) completion. But I would need
something to parse the XML and come up with the set of matching candidates
for the current input. I have no time to work on that parsing code myself -
perhaps such code exists and I could tap into it; I don't know.
I've had this project in the back of my head almost since I started working
on Icicles. Put it this way - soon after I had the idea of adding regexp
completion, I thought of adding XPath or XQuery completion. After all, the
basic infrastructure of Icicles can use any kind of matching. The hard part
(now) is doing the XQuery/XPath matching.
Anyway, just throwing this out as food for thought, in case someone finds it
interesting. I've kept it to myself long enough, without yet finding the
time to do anything about it. Actually, I did mention it on some XML lists
long ago, asking for some info about existing Emacs packages, but I never
got any reply.
IIUC, the current limited form of Emacs XML support is both a pain and an
opportunity to do something better.
next prev parent reply other threads:[~2007-06-18 0:30 UTC|newest]
Thread overview: 69+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <871wgi9jzb.fsf@jidanni.org>
[not found] ` <87odjlwpu1.fsf@jurta.org>
[not found] ` <E1HyNsO-000697-UX@fencepost.gnu.org>
[not found] ` <87ir9r1m99.fsf@jurta.org>
[not found] ` <E1Hys3j-0004Ml-Vp@fencepost.gnu.org>
[not found] ` <87myz2i9tj.fsf@jurta.org>
[not found] ` <E1HzHMV-0002cZ-DJ@fencepost.gnu.org>
[not found] ` <87r6ocx0tk.fsf_-_@jurta.org>
[not found] ` <E1HzdLq-0006ns-K7@fencepost.gnu.org>
2007-06-16 19:56 ` Saving markup formats Reiner Steib
2007-06-17 18:54 ` Juri Linkov
2007-06-17 21:08 ` Nic James Ferrier
2007-06-17 21:18 ` Lennart Borgman (gmail)
2007-06-17 21:57 ` Juri Linkov
2007-06-17 22:13 ` Lennart Borgman (gmail)
2007-06-17 22:27 ` Nic James Ferrier
2007-06-17 22:37 ` Lennart Borgman (gmail)
2007-06-17 22:47 ` Nic James Ferrier
2007-06-17 23:02 ` Lennart Borgman (gmail)
2007-06-17 23:13 ` Nic James Ferrier
2007-06-17 23:46 ` Lennart Borgman (gmail)
2007-06-18 8:03 ` Nic James Ferrier
2007-06-18 8:26 ` Lennart Borgman (gmail)
2007-06-18 8:44 ` Nic James Ferrier
2007-06-18 9:25 ` Dave Pawson
2007-06-18 21:25 ` Juri Linkov
2007-06-18 22:13 ` Nic James Ferrier
2007-06-19 7:18 ` Dave Pawson
2007-06-19 7:41 ` Nic James Ferrier
2007-06-17 23:08 ` Jason Rumney
2007-06-18 0:30 ` Drew Adams [this message]
2007-06-18 8:10 ` XML editing wishlist Lennart Borgman (gmail)
2007-06-18 13:51 ` Drew Adams
2007-06-18 14:39 ` Lennart Borgman (gmail)
2007-06-19 23:57 ` Lennart Borgman (gmail)
2007-06-20 20:49 ` Vagn Johansen
2007-06-17 21:55 ` Saving markup formats Juri Linkov
2007-06-18 21:31 ` Richard Stallman
2007-06-18 0:05 ` Oliver Scholz
2007-06-18 21:19 ` Juri Linkov
2007-06-19 7:43 ` Oliver Scholz
2007-06-19 13:38 ` Drew Adams
2007-06-19 13:59 ` Stefan Monnier
2007-06-19 22:25 ` Richard Stallman
2007-06-19 23:40 ` Nic James Ferrier
2007-06-20 0:10 ` Lennart Borgman (gmail)
2007-06-20 0:22 ` Nic James Ferrier
2007-06-20 0:38 ` Lennart Borgman (gmail)
2007-06-20 1:02 ` Nic James Ferrier
2007-06-20 2:19 ` Jeremy Maitin-Shepard
2007-06-20 8:51 ` David House
2007-06-20 10:16 ` Nic James Ferrier
2007-06-20 10:46 ` David House
2007-06-20 10:56 ` Nic James Ferrier
2007-06-20 9:45 ` Mathias Dahl
2007-06-20 10:19 ` Nic James Ferrier
2007-06-20 11:20 ` Mathias Dahl
2007-06-20 11:49 ` Nic James Ferrier
2007-06-20 0:08 ` Oliver Scholz
2007-06-20 5:37 ` David Kastrup
2007-06-20 10:05 ` Oliver Scholz
2007-06-20 10:23 ` Nic James Ferrier
2007-06-20 11:12 ` Oliver Scholz
2007-06-20 11:20 ` Nic James Ferrier
2007-06-20 12:36 ` Oliver Scholz
2007-06-20 17:36 ` Richard Stallman
2007-06-20 20:10 ` Nic James Ferrier
2007-06-21 0:05 ` Nic James Ferrier
2007-06-21 3:59 ` Davis Herring
2007-06-21 7:56 ` Nic James Ferrier
2007-06-21 10:07 ` Thien-Thi Nguyen
2007-06-21 10:31 ` Nic James Ferrier
2007-06-21 10:52 ` Kim F. Storm
2007-06-21 12:50 ` Thien-Thi Nguyen
2007-06-21 13:05 ` Davis Herring
2007-06-21 13:23 ` Nic James Ferrier
2007-06-22 1:51 ` Richard Stallman
2007-06-21 17:32 ` Richard Stallman
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=EIENLHALHGIMHGDOLMIMCEKLDCAA.drew.adams@oracle.com \
--to=drew.adams@oracle.com \
--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 public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).