>>>> "Gleb" == Gleb Arshinov
<gleb(a)broadbase.com> writes:
>>>> "Jerry" == Jerry James
<james(a)eecs.ukans.edu> writes:
Gleb> It seems like I hit the problem
previously reported in
Gleb>
http://www.xemacs.org/list-archives/xemacs-beta/200009/msg00153.html
Jerry> The problem there was that Stephen had an old version of
Jerry> PSGML installed. You appear to have the latest version,
Jerry> however. Also note that Stephen's problem was with XML,
Jerry> but your patch modifies sgml-parser-syntax. If you look at
Jerry> the code in psgml-parse.el just after your patch, you will
Jerry> see that the colon *is* in xml-parser-syntax. So this does
Jerry> not seem to be the problem previously reported.
Gleb> Hi Jerry,
Gleb> The way I read it, Stephen's problem is exact same one I am reporting.
Gleb> Let me try to provide more detail.
Jerry> What, exactly, were you trying to do, and what did PSGML do
Jerry> that you consider incorrect?
Gleb> Basically, I wanted to migrate my HTML documents from "-//W3C//DTD
Gleb> HTML 4.0 Transitional//EN" to "-//W3C//DTD XHTML 1.0
Gleb> Transitional//EN". Both are types of HTML. The latter also happens
Gleb> to be XML (XHTML is supposed to be an intersection of HTML spec and
Gleb> XML spec).
Gleb> I had old PSGML packages which did not include XHTML DTDs, so I
Gleb> upgraded all the packages to the latest versions. Then I tried to
Gleb> validate a small XHTML document:
Jerry> Can you give some example SGML that shows the problem?
Gleb> <!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN">
Please use this instead:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
so that people can easily find the canonical DTD information.
Gleb> <html>
Gleb> <head>
Gleb> <title>My Title</title>
Gleb> </head>
Gleb> <body>
Gleb> <h1>My Title</h1>
Gleb> </body>
Gleb> </html>
Gleb> Save this to a file xhtml_test.html. Open it. Run C-c C-p
Gleb> `sgml-parse-prolog'. At this point PSGML attempted to compile
Gleb> xhtml1-transitional.dtd, and barfed while parsing it (i.e. while
Gleb> parsing the DTD not the XHTML test document). The backtrace for this
Gleb> is in my original message.
I had this problem too.
I think you need to edit XHTML documents in xml-mode!
PSGML should switch to xml-mode based on a XHTML DTD, I think.
Here's what I did for the XEmacs website at
http://xemacs.sourceforge.net/[1]
See
(defun psgml-find-file-hook ()
in
http://xemacs.sourceforge.net/batch-psgml-validate.el
I should obviously rename that hook, since it's not in psgml*.el, but
in batch-psgml-validate.el.
Best regards,
Adrian
Gleb> After much scratching my head, I figured out that lines of the form:
Gleb> xml:lang language code (as per XML 1.0 spec)
Gleb> in xhtml1-transitional.dtd were causing the parsing error. When I
Gleb> removed these lines, PSGML was able to parse and compile the DTD. The
Gleb> reason parsing of this DTD fails seems to be that PSGML uses
Gleb> sgml-parser-syntax to parse the DTD and it considers ':' a
terminator
Gleb> for the token. So adding ':' to sgml-parser-syntax got rid of the
Gleb> problem for me.
Jerry> Finally, if this really is a problem with PSGML, it should
Jerry> also be reported to Lennart Staflin, the PSGML maintainer.
Gleb> The way I read Stephen's message, it worked for him in 21.2. If this
Gleb> works in 21.2 but not in 21.1, I figure XEmacs team should have the
Gleb> first try.
Gleb> Gleb
Footnotes:
[1] That site is mostly XHTML 1.0 already, automatically validated by
PSGML!
--
Adrian Aichner
mailto:adrian@xemacs.org
http://www.xemacs.org