From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Allan Gottlieb Newsgroups: gmane.emacs.help Subject: Re: sgml-validate Date: Sun, 13 Feb 2011 10:29:08 -0500 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1297610981 20372 80.91.229.12 (13 Feb 2011 15:29:41 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 13 Feb 2011 15:29:41 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Feb 13 16:29:37 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PodtH-0001b7-RZ for geh-help-gnu-emacs@m.gmane.org; Sun, 13 Feb 2011 16:29:36 +0100 Original-Received: from localhost ([127.0.0.1]:51742 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PodtG-0003sE-SL for geh-help-gnu-emacs@m.gmane.org; Sun, 13 Feb 2011 10:29:34 -0500 Original-Received: from [140.186.70.92] (port=56486 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Podsu-0003qJ-Dg for help-gnu-emacs@gnu.org; Sun, 13 Feb 2011 10:29:13 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Podst-000663-8l for help-gnu-emacs@gnu.org; Sun, 13 Feb 2011 10:29:12 -0500 Original-Received: from smtp.cs.nyu.edu ([128.122.49.97]:36349) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Podst-00065r-3t for help-gnu-emacs@gnu.org; Sun, 13 Feb 2011 10:29:11 -0500 Original-Received: from ajglap.localdomain (ool-4a59b202.dyn.optonline.net [74.89.178.2]) (authenticated bits=0) by smtp.cs.nyu.edu (8.14.3/8.14.4) with ESMTP id p1DFT9gV000078 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Sun, 13 Feb 2011 10:29:09 -0500 (EST) Original-Received: by ajglap.localdomain (Postfix, from userid 1502) id F1C0870202; Sun, 13 Feb 2011 10:29:08 -0500 (EST) In-Reply-To: (William F. Hammond's message of "Sat, 12 Feb 2011 19:39:23 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 128.122.49.97 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:79104 Archived-At: On Sat, Feb 12 2011, William F. Hammond wrote: >>> When I tried M-x sgml-validate, it offers to run >>> nsgmls -s myfile.html >>> >>> I don't have nsgmls so looked around and found >>> opensp providing onsgmls and a gentoo bug report claimed >>> a symlink nsgmls --> onsgmls. >>> >>> Emerged opensp and now have onsgmls. >>> >>> But onsgmls -s myfile.html >>> just hangs and uses no CPU time. >>> >>> onsgmls claims it will validate "the SGML document whose document entity is >>> specified by the system identifiers SYSID..." so perhaps my error is in >>> supplying just a file name. What is needed for a valid SYSID? > >> AFAIU that's rather an sgml-issue. >> >> Seems the command onsgmls fails, which should happen too for the very >> reasons also from the command line outside Emacs. >> >> BTW I use `xmllint' for validation, may be it's ok for your purposes too. > > onsgmls is a very reliable tool. In general, however, it requires > complicated command lines. Agreed. I have given up since I was not able to figure out how to have it "not validate" and xmllint has that ability. The validation adds minutes to the test so needs to be used sparingly. > AIUI "xmllint" works only on xml files, and, therefore, probably won't > work with most extant html files, even those self-identified as > the xml form of html, which commonly are not "well-formed xml". > (Xml well-formedness is easily and quickly checked using James Clark's > "xmlwf" that is included with "expat" distributions.) Thank you very much for this tip. I ran xmlwf and my html passed! This was made possible in large part by sgml-xml-mode. I believe xmllint also validates, but xmlwf has the plus of speed and not commenting about entities (see below). > If your html is dependably well-formed xml, then take your questions > to comp.text.xml. Otherwise maybe take them to > comp.infosystems.www.authoring.html unless you really, really want a > full understanding of the sgml background for html in which case ask > in the rather quiet group comp.text.sgml. Actually I am now doing OK thanks to the help I received here. The only annoyance is that xmllint keeps telling me that ≥ et al are not valid entities. > Furthermore, be aware that the proposal for future html5 served as > "text/html" falls outside of all classical sgml/xml validation > paradigms. Thanks for the warning. allan