What is the best package for editing XML in emacs

What is the best package for editing XML in emacs

Post by Sony Anto » Sun, 15 Jun 2003 05:08:36



I just moved to emacs from vi. Current project requires editing XML.
Searching the web, I came across a number of list packages to enhance
emacs like PSGML, XAE, tdtd etc. Is there a 'best package' for this.
One that is most popular that it is almost the industry standard.
--sony
 
 
 

What is the best package for editing XML in emacs

Post by Kai Gro?joha » Sun, 15 Jun 2003 05:47:10



> I just moved to emacs from vi. Current project requires editing XML.
> Searching the web, I came across a number of list packages to enhance
> emacs like PSGML, XAE, tdtd etc. Is there a 'best package' for this.
> One that is most popular that it is almost the industry standard.

tdtd is for editing DTDs.  XAE is a wrapper that integrates a number
of other packages, PSGML amongst them.

I know of two modes.  One is sgml-mode that comes with Emacs.  It has
facilities for editing XML, too.  It is a fairly simple mode that
does not know about DTDs.  It will allow you to create well-formed
XML easily.

Then there is PSGML which reads DTDs and offers improved support for
editing based on the DTD.  If your XML is based on a DTD, then PSGML
is probably the better choice.

Then there is xxml.el which is an addon for PSGML.  Contrary to the
name, it can be used for (some) SGML, too -- works with HTML, for
instance.  It does not do much, just change the syntax highlighting
to be more colorful.

Does this help?
--
This line is not blank.

 
 
 

What is the best package for editing XML in emacs

Post by chris.dan » Sun, 15 Jun 2003 07:20:39



> I just moved to emacs from vi. Current project requires editing XML.
> Searching the web, I came across a number of list packages to enhance
> emacs like PSGML, XAE, tdtd etc. Is there a 'best package' for this.
> One that is most popular that it is almost the industry standard.
> --sony

I use an XSL mode for editing xml from
http://www.mulberrytech.com/xsl/xslide/

It works fairly well and has autocompletion of elements (if you start to
close an element with "</" it'll match the nearest open element).  The
only problem is it distinguishes between <x/> and <x /> and indents
funny for the second one.

Chris

 
 
 

What is the best package for editing XML in emacs

Post by Sony Anton » Sun, 15 Jun 2003 11:20:39


Quote:

> Then there is PSGML which reads DTDs and offers improved support for
> editing based on the DTD.  If your XML is based on a DTD, then PSGML
> is probably the better choice.

> Then there is xxml.el which is an addon for PSGML.  Contrary to the
> name, it can be used for (some) SGML, too -- works with HTML, for
> instance.  It does not do much, just change the syntax highlighting
> to be more colorful.

> Does this help?

You are obviously very knowledgeable on this topic.

Do you feel its worth it to use one of those XML editors like XML spy, etc.
Or should I IOW are there functionalities that such provide that is really
benificial. I dont even know what to expect. I haven t used any of them. I
can t think of anything other than syntax completion using DTDs and colored
highlighting.

--sony

 
 
 

What is the best package for editing XML in emacs

Post by Artur Hefczy » Sun, 15 Jun 2003 17:23:31



>> I just moved to emacs from vi. Current project requires editing XML.
>> Searching the web, I came across a number of list packages to enhance
>> emacs like PSGML, XAE, tdtd etc. Is there a 'best package' for this.
>> One that is most popular that it is almost the industry standard.
> I use an XSL mode for editing xml from
> http://www.mulberrytech.com/xsl/xslide/
> It works fairly well and has autocompletion of elements (if you start to
> close an element with "</" it'll match the nearest open element).  The
> only problem is it distinguishes between <x/> and <x /> and indents
> funny for the second one.

The question was about XML instead of XSL.
For simple XML editing I can suggest xml-lite package - simple and easy to use
and configure. It provides text intendation, colorizing, and some simple
completing like closing current tags.
For more advanced features you should try psgml package, complex
but very reach of features, really helpful.

I started editing XML files with xml-lite, but now I use only psgml.
For more info about both packages you can go here:
http://212.76.54.141/~kobit/emacsandxml.html

I am still working on this document so please return back to it in some
time, I hope it will help.

Artur
--
Artur Hefczyc
Open Source Developer
http://www.geotools.org/
http://wttools.sourceforge.net/

 
 
 

What is the best package for editing XML in emacs

Post by Kai Gro?joha » Mon, 16 Jun 2003 05:16:05



>> Then there is PSGML which reads DTDs and offers improved support for
>> editing based on the DTD.  If your XML is based on a DTD, then PSGML
>> is probably the better choice.

>> Then there is xxml.el which is an addon for PSGML.  Contrary to the
>> name, it can be used for (some) SGML, too -- works with HTML, for
>> instance.  It does not do much, just change the syntax highlighting
>> to be more colorful.

>> Does this help?

> You are obviously very knowledgeable on this topic.

Really?

Quote:> Do you feel its worth it to use one of those XML editors like XML
> spy, etc.

I've never used any of them, I'm afraid.  Whee.  Maybe I shouldn't be
such an Emacs weenie.  But, there you are, I am.

Maybe some others can tell you what "real" XML tools can do.
--
This line is not blank.

 
 
 

1. editing an xml file

I have a directory of jabber xml files which are accounts from our internal
jabber server. The files look like this:

<xdb><password xmlns='jabber:iq:auth'
xdbns='jabber:iq:auth'>user1</password><query xmlns='jabber:iq:register'
xdbns='jabber:iq:register'><username>user1</username><x
xmlns='jabber:x:delay' stamp='20041022T22:08:45'>registered</x></query><foo
xmlns='jabber:x:offline' xdbns='jabber:x:offline'/><query
xmlns='jabber:iq:last' last='1098723624'
xdbns='jabber:iq:last'>Disconnected</query></xdb>

All of the XML is squashed together so it's all in a single string. What I
need to do is insert the username and password (which are the same) in the
appropriate tags. I tried recreating the xml files but I'm unable to get the
perl-based xml generator utilities to work for me. Plan B is just to edit
the usernames and passwords with something like sed.

Is there a regular expession that will let me replace the text between these
tags?

<password xmlns='jabber:iq:auth' xdbns='jabber:iq:auth'>replace this
text</password>

and this one:

<username>replace this text</username>

I know I can search for a line based on a string of text, I just don't know
how I would seach a substring of this line and then swap out all text before
the beginning of the closing xml tag. Also, it's my understanding that
special chars can be escaped with a backslash. If this is so, then is this
incorrect in some other way?

/\<username\>/

Any help would be much appreciated.

2. does linux support the HP scanjet 3570c?

3. Best way to write plug-ins?

4. The Theory of Linux Advocacy

5. Which tree structure is best for Xml?

6. new Kernel 2.0.30 crashes...SCSI problem.

7. XML SIG meeting Tuesday 24 August 1999: Elliotte Rusty Harold speaks on XML

8. 2.0.30 won't reboot w/o hardware reset

9. Best XML Parser for C++/Java

10. Configuring Apache Jserv to recognise XML as correct context type of text/xml

11. Which packages to load with apache, php, perl, mysql, xml

12. GTK Widget, Bonobo/CORBA app, or Emacs handles suitable for C source code editing?

13. Q: Redefining the command line editing keys in ksh VISUAL=emacs