Data recovery software tools & file recovery utilities to recover lost data
WestNIC provides reliable web hosting services
SSL Certificates for ecommerce secure servers.
Find the best Dedicated Servers and Reseller Hosting
Advance Linux Recovery and Windows Partition Recovery Software
The NSGMLS program is the SGML parser that sits behind the W3C and Web Design Group's online validators. To save time online, NSGMLS can easily be installed on a Windows workstation and integrated with most standard markup editors to check your HTML or XHTML as you go. This article explains how.
.dcl) and Oasis Open Catalog files (.soc).
Extract the SP package to a directory with a short path and no spaces, such as C:\sp; this will make configuration slightly simpler. The SP package includes a main sp directory and three sub-directories:
bin
nsgmls.exe.
doc
nsgmls.htm for further details).
pubtext
The W3C zip archive includes three DTDs for Strict, Transitional and Frameset document types, and the relevant entity sets, SGML declarations and Open Catalog files for XHTML. Extract all these files to the SP pubtext directory for convenience, to keep them with their HTML equivalents.
NSGMLS is purely a command line program that may be passed a range of runtime arguments, a full listing is included in the package documentation. The two key parameters are the path to the program itself and the file to parse. For HTML validation, the following arguments will likely be useful too:
-c
This case sensitive argument specifies a file that is essentially a pointer to the relevant SGML Open Catalog file in the pubtext directory. The catalog entry file maps the PUBLIC identifier given in a Document Type Declaration to local copies of the Document Type Definition in the pubtext directory. The syntax is to follow the argument directly with the system identifier for the catalog file, e.g.
C:\sp\bin\nsgmls.exe -cC:\sp\HTML4.txt
For HTML 4 validation, the contents of the HTML4.txt file would be a single line that refers to the HTML 4 Open Catalog file:
CATALOG pubtext/html4.soc
-s
This argument suppresses the output of the source markup and only lists the errors, e.g.
C:\sp\bin\nsgmls.exe -s c:\source\MyMarkup.htm
This argument limits the output to a specified number of errors, e.g. the first 5 errors only:
C:\sp\bin\nsgmls.exe -E5 c:\source\MyMarkup.htm
A complete validation command for XHTML 1.0 may be constructed as follows:
C:\sp\bin\nsgmls.exe -cC:\sp\XHTML1.txt -s -E10 c:\source\MyMarkup.htm
This parse would use the XHTML catalog entry file, suppress the output of the original markup and only list the first 10 errors in the file MyMarkup.htm.
Your documents will need to have a suitable Document Type Declaration to match those specified in the relevant SGML Open Catalog file (.soc). See the HTML and XHTML recommendations for more details.
NSGMLS can be run directly from the system shell using the commands outlined above. However, any good text or markup editor should have the facility to run such programs directly on the current file. The examples below show how to set up NSGMLS with EditPlus, TextPad and UltraEdit for Windows. These cases should indicate how to make equivalent settings in your own development environment.
In all cases, the NSGMLS validation is run on the file that is currently selected in the editor window. Bear in mind that with the -s argument, NSGMLS will not produce any output if your markup is valid. Use the -E argument to limit the number of errors listed.
The EditPlus text editor is available at http://www.editplus.com/.
nsgmls.exe program in the bin directory.
$(FilePath) parameter for the current file.
This validation option can be accessed via the Tools menu and will have a keyboard shortcut assigned.
The TextPad text editor is available at http://www.textpad.com/.
nsgmls.exe program in the bin directory.
$File parameter to specify the current file.
TextPad applies output capture settings by default to list the validation results in the editor window. The new validation option can be accessed via The Tools menu and will have a keyboard shortcut assigned.
The UltraEdit text editor is available at http://www.ultraedit.com/.
nsgmls.exe program in the bin directory.
%F parameter to specify the current file.
%P parameter.
This validation option can be accessed via the Advanced menu, and will have a keyboard shortcut assigned.