Mailing List Archive


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

Re: [tlug] Syntax highlighting for XML Schema (XSD) files in XEmacs



"Stephen J. Turnbull" <stephen@example.com>, 2006-11-20 15:40 +0900:

> Josh Glover writes:
> 
>  > Any of you XEmacs users out there *koff*Steve Turnbull*koff* know of a
>  > major mode that will offer nice syntax highlighting and
>  > auto-completion for XML Schema files? I am pleased as pie with
>  > xsl-mode, and just want something like it for XML Schema. Why is there
>  > no xsd-mode? :(
> 
> You might look inside the xslide and xslt-process packages, but I
> think they're quite different.
> 
> You could also try nxml-mode but I have no further idea about that.
> <URL:http://www.emacswiki.org/cgi-bin/wiki/NxmlMode>

I did a writeup about nxml-mode for the O'Reilly "XML Hacks" book
a couple of years back:

  http://hacks.oreilly.com/pub/h/2044
  http://www.oreilly.com/catalog/xmlhks/chapter/hack12.pdf

I repurposed most of that from a news item I wrote for XMLHack on
nxml-mode when James Clark first released it -

  http://www.xmlhack.com/read.php?item=2061

There's some other info about nxml-mode here:

  http://www.thaiopensource.com/nxml-mode/

If you want something with good support for syntax highlighting,
nxml-mode is great because its highlighting is completely
configurable (see below for the chunk of my .emacs that has the
highlighting customizations that I use).

But note that if you want to have auto-completion when you edit
XSD files in nxml-mode, you'd need to point nxml-mode at a RELAX
NG grammar for the XSD (W3C XML Schema) language itself. (I don't
know if there is actually such a thing.) Otherwise, you'd just be
doing well-formedness editing (not validated editing).

Anyway, the big downside of nxml-mode is that (for some reason),
it doesn't work in XEmacs -- only with GNU Emacs. But if you can
bear to work in GNU Emacs, I think you'll find nxml-mode to your
liking.

  --Mike

  (nxml-attribute-local-name-face ((t (:inherit font-lock-type-face))))
  (nxml-attribute-prefix-face ((t (:inherit nxml-ref-face))))
  (nxml-attribute-value-face ((t (:foreground "LightSalmon"))))
  (nxml-delimiter-face ((t (:foreground "light slate gray"))))
  (nxml-element-prefix-face ((t (:inherit nxml-delimiter-face))))
  (nxml-entity-ref-name-face ((t (:inherit nxml-ref-face))))
  (nxml-namespace-attribute-colon-face ((t (:inherit nxml-delimiter-face))))
  (nxml-namespace-attribute-prefix-face ((t (:inherit nxml-ref-face))))
  (nxml-namespace-attribute-xmlns-face ((t (:inherit nxml-delimiter-face))))
  (nxml-prolog-literal-content-face ((t (:foreground "PaleGreen"))))
  (nxml-ref-face ((nil (:foreground "RosyBrown" :bold t))))
  (nxml-tag-slash-face ((t (:inherit nxml-delimiter-face))))
  (rng-error-face ((t (:background "thistle3" :foreground "black" :underline "red"))))

-- 
Michael(tm) Smith
xmpp:smith@example.com
irc://irc.freenode.net/mobile-web


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links