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

Re: SGML validation in emacs



Chris Tillman writes:
> 
> I am a Debian/Unix/Emacs/SGML newbie. I just installed a stable potato 
> system last month, and installed the debiandoc-sgml package last week. I'm
> starting to get a little more comfortable with emacs. Anyway, I have
> attempted to validate the SGML documents I was working on and ran into a few
> difficulties. Perhaps someone could enlighten me.
> 
> Within the emacs sgml mode, the docs say I can use C-c C-v to validate the
> sgml in the document I'm working on. When I do, it errors out saying it
> can't find the program sgmls. 

Chris,

Dunno. I've never seen emacs ask for sgmls. But...

> I tried looking for that package with dpkg,
> but as far as I can tell nsgmls has replaced it. 

It should be part of the sp package. Try dpkg -S /usr/bin/nsgmls

> How do I tell emacs it has
> the wrong package name?

You can set the validate command to whatever you like by putting
something like:

 (setq sgml-validate-command "nsgmls -s %s %s")

in your .emacs. The command above is, or should be, the default for
the stable deb version (1.2.1-9) of psgml.


> When I run nsgmls from the shell on the file in question, I get buku errors
> regarding closing of tags. I suspect that's because the files on which I'm
> working (e.g. boot-floppies/documentation/en/rescue-boot.sgml) are not
> standalone documents, but are inserted as sections into the larger
> boot-floppies/documentation/install.sgml document. 

> The install.sgml document has a DTD reference;
> if I'm running nsgmls on the section document, how can I tell it where to
> find the DTD?

You can tell psgml that the current doc has a parent, and it'll look
in the parent for the doctype declaration. Put something like this at
the bottom of your rescue-boot.sgml file:

<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-parent-document:("install.sgml" "book" "chapter")
End:
-->

- Include the relative path to install.sgml, if applicable.

- "book" is the top-level element of the parent (install.sgml)

- "chapter" is the top-level element of rescue-boot.sgml

You might have to save & reload rescue-boot.sgml for emacs to
understand...
> 
> Are there even more useful tools lying around for working on sgml?

The color-themes package is pretty cool. I made some additional themes
for sgml-mode as add-ons to the color-theme package. The themes
provide syntax highlighting with bolface tags. They're not for
everyone, though.

Links & screenshots are here:

 http://dulug.duke.edu/~mark/software.html

If you like this sort of thing, you might wanna try the psgmlx
tarball/package I hacked together. It includes the color-theme stuff
and a gazillion other things. I put it together because all the
emacs/sgml newbies areound here kept asking me how to make emacs more
friendly. It may not be your cup of tea, but it's really easy to test
drive, (1. Untar, 2. cd into dir, 3. run the test script) and it won't
muck with your current setup.

If you do try it, send me your complaints.

Hope that helps.

Mark

> --
> 
> Chris Tillman
> tillman@azstarnet.com
> 
> 
> --  
> To UNSUBSCRIBE, email to debian-sgml-request@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

-- 
_____________________________________

Mark Johnson
Senior Lecturing Fellow
111 Physics Bldg., Box 90305
Department of Physics 
Duke University
Durham, NC 27708-0305
(919) 660-2504  Fax: (919) 660-2525   



Reply to: