Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

emacs as an XML editor

261 views
Skip to first unread message

Giulio Petrucci

unread,
Feb 22, 2011, 9:46:51 AM2/22/11
to
Hi there,

I'm searching a way to use Emacs as an xml editor. What I need is:
1. a bit of syntax highlight
2. validation against an XSD scheme
3. some code completion if the XSD scheme is provided
4. the possibility to run some XPath queries on the document
Please, keep in mind that I work mostly on WinXP. :-)

Thanks in advance,
Giulio

--


Le Wang

unread,
Feb 22, 2011, 11:23:41 AM2/22/11
to Giulio Petrucci, help-gn...@gnu.org
nxml, convert your xsd to rng.
--
Le

Giulio Petrucci

unread,
Feb 22, 2011, 11:28:10 AM2/22/11
to
Hi Le Wang,

first of all thank you for your quick reply.

On 2/22/2011 5:23 PM, Le Wang wrote:
> nxml, convert your xsd to rng.

Uhm... I'm trying it but when I open an .xsd scheme I have a message in
the minibuffer saying: "No scheme loader available for file extension
'xsd'".
I know I'm doing something wrong but I can't get *what* (as I'm quite a
n00b). :-)

thanks,
Giulio

--

Le Wang

unread,
Feb 22, 2011, 11:48:15 AM2/22/11
to Giulio Petrucci, help-gn...@gnu.org
I don't work with nxml very often, but see here: http://stackoverflow.com/questions/917337/schema-sensitive-editing-in-emacs-based-on-w3c-xml-schema-not-rng

Nxml only understands rng schema.
--
Le

mcun...@comcast.net

unread,
Feb 22, 2011, 4:12:22 PM2/22/11
to help-gn...@gnu.org
nxml does not understand xsd schemas or rng schemas, only rnc (relaxng compact syntax) so you need to convert whatever schema you have to rnc. That done, emacs makes a good xml editor.

Morgan

Andreas Röhler

unread,
Feb 23, 2011, 1:40:31 PM2/23/11
to help-gn...@gnu.org

Giulio Petrucci

unread,
Feb 25, 2011, 4:16:49 AM2/25/11
to
Hi Andreas,

On 2/23/2011 7:40 PM, Andreas Röhler wrote:
> have a look at
> http://www.emacswiki.org/emacs/PsgmlMode

I already know the PsgmlMode but... I still couldn't use it in a
productive way. :-) I think it's a generale issue about every emacs
mode: the first "step" in the learning curve is very hard and every
documentation you may found seems to speak to an expert user. Maybe I
need just a little patience... ;-)

Thanks,
Giulio

--


Andreas Röhler

unread,
Feb 25, 2011, 10:59:57 AM2/25/11
to help-gn...@gnu.org

yes, the beginning might be hard, remember that well.... :-)

Maybe tell what you want to do task by task, so we may see which command
to use, how to proceed resp. where and why a stop occurs.


Andreas

--
https://code.launchpad.net/~a-roehler/python-mode/python-mode-components
https://code.launchpad.net/s-x-emacs-werkstatt/


Giulio Petrucci

unread,
Feb 28, 2011, 1:11:58 PM2/28/11
to
Hi Andreas,

On 2/25/2011 4:59 PM, Andreas Röhler wrote:
> yes, the beginning might be hard, remember that well.... :-)

Not only the beginning. :-(

> Maybe tell what you want to do task by task, so we may see which command
> to use, how to proceed resp. where and why a stop occurs.

Nothing special, actually.
- Open an XML file
- use an XSD scheme file to validate the document and have some
intelli-sense support.

I'm trying to use trang (but it doesn't works for xsd to rng conversion)
and xsdtorngconverter (but it just freak the scheme out). :-(

thanks,
Giulio

--

Steinar Bang

unread,
Mar 6, 2011, 1:33:40 PM3/6/11
to help-gn...@gnu.org
>>>>> Giulio Petrucci <sis...@nonono.boh>:

> Hi there,
> I'm searching a way to use Emacs as an xml editor. What I need is:
> 1. a bit of syntax highlight

nxml-mode can do that.
http://www.thaiopensource.com/nxml-mode/

Part of emacs24, I think. Also available from ELPA
http://tromey.com/elpa/

(ELPA install works on windows emacs as well)

> 2. validation against an XSD scheme

Nope. nnxml-mode only does Relax-NG (actually RNC, ie. the "compact"
notation).

But an utility named trang can convert from XSD to RNG
http://www.thaiopensource.com/relaxng/trang.html

(trang is written in Java and so should work on windows)

Note that if you are writing the schema yourself, then writing a schema
in Relax-NG is a _lot_ nicer than writing an XSD schema. And you can
use trang to create an xsd schema from the Relax-NG schema.

> 3. some code completion if the XSD scheme is provided

Nope. But code competion against the RNG schema is provided.

> 4. the possibility to run some XPath queries on the document

Nope.

0 new messages