🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.text.sgml
Article #742

Re: Psgml and ECAT

#742
From: Viktor Haag
Date: Thu, 29 Apr 1999 00:00
145 lines
7392 bytes
ronross@colba.net writes:

> On 28 Apr 1999, vhaag@rim.net wrote:
> 
> I've mentioned it before on the nt-emacs list, but it bears
> repeating: anyone getting into SGML with NT Emacs for the first
> time will be immensely rewarded by visiting Markus Hoenicka's
> pages devoted to the subject:
> 
> http://ourworld.compuserve.com/homepages/hoenicka_markus/ntsgml.html

I second that. It's a wonderful site.

> Markus ties together a lot of the packages required to setup a
> complete SGML publishing environment, which Psgml on its own is
> not meant to be. At the very least, you want a
> validator. Presumably, you would also like to output your sgml
> instances by coupling them with some formating
> instructions. Both a validator and DSSSL stylesheet processor
> are included in Jade. Then you want a choice of DTDs; and there
> are modes for editing DTDs, and DSSSL stylesheets,...This site,
> as long as it exists, should be included the SGML topic in the
> FAQ. The FAQ should probably also simply list the URIs of the
> essential packages themselves as well: Jade, tdtd.el,
> psgml-dsssl.el, psgml-jade.el, as well as psgml.

I agree -- I was more trying to answer the ECAT stuff, and
discovered that the PSGML FAQ entry didn't exist. It should
definitely point to Markus' page.

> > * Go to the directory that contains your DTDs
> 
> When PSGML compiles the DTD it prompts for the file name of the
> compiled file in the minibuffer, which it fills with its
> default value. But you can simply edit this to change the path
> and filename to indicate an appropriately named .ced file in
> the directory of your choice. Hit RET and the compilation
> proceeds. It worked for me (nt emacs 20.3.1 and psgml 1.1.6).

You're right. I just find it easier myself to go to the DTD
directory, since I typically want to edit the DTDs a little and
then compile them.

> > * In that directory create a temporary instance that contains
> >   only the <!DOCTYPE> for the DTD you want to compile.
> >
> > * Parse the DTD (type C-c C-p, invoke sgml-parse-prolog, go to
> >   the end of the buffer and press TAB, or choose DTD->Parse DTD)
> 
> Yes, definitely parse the DTD first. But I would further
> suggest that you also validate the instance before
> compiling. Nsgmls (the parser included in James Clark's Jade)
> will uncover inconsistencies in DTDs and entities that Psgml
> will blithely ignore.

Since I use PSGML almost exclusively for editing HTML files (and
pre-4 HTML files at that), I personally don't have a real need
for a parser or validator outside PSGML. However you're perfectly
right, I think, that the "real" SGML user will definitely want to
proceed as you suggest.

> Also, the latest HTML DTDs (version 4) come in three flavors,
> and if you're going to produce varied types of pages, you'll
> want all three as well as the earlier 3.2. These are
> strict.dtd, loose.dtd (otherwise called HTML 4 Transitional),
> and frameset.dtd. This pertains to compilation because the
> frameset.dtd is just a driver for the elements in the loose.dtd
> (note that I've seen these DTDs under slightly different,
> though pretty recognizable names). You'll want to compile the
> frameset DTD _before_ compiling the loose DTD. Doing the
> reverse caused problems for me.

Good points -- I personally don't use HTML 4 yet, so I wasn't
aware of these additional wrinkles.

> [While we're on this subject, I don't know about others'
> experience, but I have had to edit the entity identifiers in
> all the latest HTML DTDs because they pointed to the W3
> Consortium's web site. PSGML chokes on this, while Nsgmls, when
> invoked to validated the instance, takes it in stride, dials up
> my ISP, reads the remote entity files, and validates my
> document. This, in fact, is a stumbling block long before you
> get to compiling the DTD. Assuming you've also gotten all the
> required entities from somewhere (W3C is a good choice), then
> you have to edit the entity reference, as I have, for example,
> from (line 169 in the loose.dtd):
> 
> <!ENTITY % HTMLlat1 PUBLIC
>    "-//W3C//ENTITIES Latin1//EN//HTML"
>    "http://www.w3.org/TR/REC-html40-971218/HTMLlat1.ent">
> %HTMLlat1;
> 
> to
> 
> <!ENTITY % HTMLlat1 PUBLIC
>    "-//W3C//ENTITIES Latin1//EN//HTML"
>    "HTMLlat1.ent">
> %HTMLlat1;
> 
> having put the entity files (ex: HTMLlat1.ent) in the same
> directory as the DTDs. It seems a little strange to have to do
> this (yes, I have correctly referenced them in my catalog
> file); did I overlook something stupid?... Anyway, it's
> something to look out for when setting things up.]

More useful information that should go in a FAQ entry.

> Sgml-catalog-files can be set as a system environment variable,
> and therefore not dealt with within Emacs at all; the elisp
> variable takes its value from the environment. Doing it this
> way is required, I think, if you're going to get the other
> tools working together as well. The 'sgml-ecat-files' variable
> can also be set very simply in Customize. But I'm wondering, in
> terms of straight elisp, why can't the variable be set with a
> simple (setq sgml-ecat-files "mySGMLpath/ecatalog") on its own,
> i.e., not in a hook to sgml-mode?

I had several reasons for doing it the way I did -- first off, as I
said, I almost exclusively use PSGML mode to edit only
HTML. Therefore, I don't use other tools. Next, my PSGML setup
comes from the days before customize, and I just haven't bothered
to change it 8-). Thirdly, I have all the stuff in my sgml hook
in the interests of not cluttering Emacs' symbol space until
necessary -- however, I'm perfectly willing to admit that perhaps
this is a completely naive and unnecessary practice.


> Overall, Viktor, your post represents an excellent
> initiative. Pesky little configuration issues seem to abound
> and sometimes spoil the fun.  But I'm wondering about the form
> discussion can take on a cross-posted message? I'm replying now
> on two out of three of the lists (since the subject seems
> relevant to both), but I can't see keeping it up very
> long... hm.

Well, I posted back to all three groups, since I don't know which
of them you left out. I've also cc'd my reply to the NTEmacs
mailing list. I don't have any real intention on keeping a
lengthy discussion going, but you made such good points that I
thought I'd just add some commentary. I'll bow out now...

-- 
Viktor Haag                          Senior Technical Writer, RIM
"Unix and C are the ultimate computer viruses." -- Richard Gabriel
My opinions are my own, only.
Technical Details
Message-ID: <wkr9p3a763.fsf@rim.net>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <7g7lnk$l15$1@nnrp1.dejanews.com> <wk90bcbiah.fsf@rim.net> <7g8hm9$dse$1@nnrp1.dejanews.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fa82c,8efbbedde372ba6e
X-Google-Attributes: gidfa82c,public
X-Google-Thread: 102b9a,e414c2003a82bdac
X-Google-Attributes: gid102b9a,public
X-Google-Thread: 103b8b,e414c2003a82bdac
X-Google-Attributes: gid103b8b,public
From: Viktor Haag <vhaag@rim.net>
Subject: Re: Psgml and ECAT
Date: 1999/04/29
Message-ID: <wkr9p3a763.fsf@rim.net>
X-Deja-AN: 472291159
X-NNTP-Posting-Host: vhaag.rim.net
Sender: vhaag@VHAAG
References: <7g7lnk$l15$1@nnrp1.dejanews.com> <wk90bcbiah.fsf@rim.net> <7g8hm9$dse$1@nnrp1.dejanews.com>
X-Trace: 29 Apr 1999 09:34:38 -0400, proxy3.rim.net
Newsgroups: comp.text.sgml,comp.emacs,gnu.emacs.help