ONSGMLS(1)
π ONSGMLS(1) β the one and only π
okay bestie, sit down, hydrate, because we're about to talk about onsgmls β your friendly neighborhood SGML/XML parser and validator π«Ά. This is the reference page, so grab a snack, we're going in.
β¨ NAME β¨
onsgmls β An SGML/XML parser and validator. she parses, she validates, she serves cunt π
π SYNOPSIS π
onsgmls [-BCdeghlnpRrsuvx] [-alinktype] [-Aarchitecture] [-bbctf]
[-csysid...] [-Ddirectory] [-Emax_errors] [-ffile] [-iname]
[-ooutput_option...] [-tfile] [-wwarning_type...] [sysid...]
πΈ DESCRIPTION πΈ
so here's the vibe: onsgmls parses and validates the SGML document whose document entity is specified by the sysid system identifiers.
Then it prints on standard output a cute lil' simple text representation of its Element Structure Information Set. (That's the information set a structure-controlled conforming SGML application should act upon β iykyk.) If you hand it more than one system identifier, the corresponding entities get concatenated to form the document entity. so the document entity can be spread across several files, no big deal. for example, the SGML declaration, prolog and document instance set could each live in their own separate file. and if you specify no system identifiers at all? onsgmls will read the document entity from standard input. a command line system identifier of - can be used to refer to standard input. (and normally in a system identifier, <OSFD>0 is what refers to standard input, just so you know π)
Part of an SGML System Conforming to International Standard ISO 8879 β Standard Generalized Markup Language. Also an SGML Extended Facilities system conforming to Annex A of Internal Standard ISO/IEC 10744 β Hypermedia/Time-based Structuring Language. iconic honestly π
The following options are available:
π OPTIONS π
-alinktype,--activate=linktypeβ makes link type linktype active. But heads up bestie, in this case not all ESIS information is output: the active LPDs are not explicitly reported, although each link attribute is qualified with its link type name; there's no info about result elements; and when there are multiple link rules applicable to the current element,onsgmlsalways chooses the first. no takebacks π«Ά-Aarchitecture,--architecture=architectureβ parse with respect to architecture architecture.-bbctf,--bctf=bctf,-bencoding,--encoding=encodingβ this one determines the encoding used for output. If in fixed character set mode, it specifies the name of an encoding; if not, it specifies the name of a BCTF.-B,--batch_modeβ batch mode, periodt. Parse each sysid specified on the command line separately, rather than concatenating them. This is useful mainly with-s.
If -tfilename is also specified, then the specified filename will be prefixed to the sysid to make the filename for the RAST result for each sysid.
-csysid,--catalog=sysidβ map public identifiers and entity names to system identifiers using the catalog entry file whose system identifier is sysid. Multiple-coptions are allowed. And if there's a catalog entry file calledcatalogin the same place as the document entity, it'll be searched for immediately after those specified by-c. she's thorough like that π-C,--catalogsβ the sysid arguments specify catalog files rather than the document entity. The document entity is then specified by the firstDOCUMENTentry in the catalog files.-Ddirectory,--directory=directoryβ search directory for files specified in system identifiers. Multiple-Doptions are allowed. See the description of theosfilestorage manager for more info about file searching, bestie.-e,--open-entitiesβ describe open entities in error messages. Error messages always include the position of the most recently opened external entity. no hiding, she tells you exactly where it went wrong π«Ά-Emax_errors,--max-errors=max_errorsβonsgmlswill exit after max_errors errors. If max_errors is0, there is no limit on the number of errors. The default is200.-ffile,--error-file=fileβ redirect errors to file. This is useful mainly with shells that do not support redirection ofstderr.-g,--open-elementsβ show the generic identifiers of open elements in error messages.-h,--helpβ show a help message and exit. the classic π-iname,--include=nameβ pretend that
<!ENTITY % name "INCLUDE">
occurs at the start of the document type declaration subset in the SGML document entity. Since repeated definitions of an entity are ignored, this definition will take precedence over any other definitions of this entity in the document type declaration. Multiple -i options are allowed. If the SGML declaration replaces the reserved name INCLUDE then the new reserved name will be the replacement text of the entity. Typically the document type declaration will contain
<!ENTITY % name "IGNORE">
and will use %name; in the status keyword specification of a marked section declaration. In this case the effect of the option will be to cause the marked section not to be ignored. sneaky but make it legal π
-n,--error-numbersβ show message numbers in error messages.-ooutput_option,--option=output_optionβ output additional information according to output_option:entityβ Output definitions of all general entities not just for data or subdoc entities that are referenced or named in anENTITYorENTITIESattribute.idβ Distinguish attributes whose declared value isID.lineβ OutputLcommands giving the current line number and filename.includedβ Output anicommand for included sub-elements.emptyβ Output anecommand for elements which are not allowed to have an end-tag, that is those with a declared content of empty or with a content reference attribute.notation-sysidβ Output anfcommand before anNcommand, if a system identifier could be generated for that notation.nonsgmlβ In fixed character set mode, output\%escape sequences for non-SGML data characters. Non-SGML data characters can result from numeric character references.data-attributeβ Output the notation name and attributes forDATAattributes. Otherwise,DATAattributes are treated likeCDATAattributes. For more details see clause 4.4.3 of Annex K of ISO 8879.commentβ Output an_command with the contents of a comment. Multiple comments in a single comment declaration will result in multiple distinct_commands, just as if the comments were each in a separate comment declaration.omittedβ Output anocommand before a command which was implied by the input document, but omitted from the actual markup. This currently affects(,)andAcommands.tagomitβ Asomitted, but only for(and)commands.attromitβ Asomitted, but only forAcommands.
Multiple -o options are allowed. stack 'em, bestie π
-p,--only-prologβ parse only the prolog.onsgmlswill exit after parsing the document type declaration. Implies-s. short and efficient, we love her π-R,--restrictedβ restrict file reading. This option is intended for use withonsgmls-based Web tools (e.g. CGI scripts) to prevent reading of arbitrary files on the Web server. With this option enabled,onsgmlswill not read any local files unless they're located in a directory (or subdirectory) specified by the-Doption or included in theSGML_SEARCH_PATHenvironment variable. As a further security precaution, this option limits filenames to the charactersA-Z,a-z,0-9,'?',.,_,-and does not allow filenames containing"..". On systems with MS-DOS file names,':'and'\'are also allowed.
bestie this one is a security thing, do not skip it π¨
-s,--no-outputβ suppress output. Error messages will still be printed.-tfile,--rast-file=fileβ output to file the RAST result as defined by ISO/IEC 13673:1995 (actually this isn't quite an IS yet; this implements the Intermediate Editor's Draft of 1994/08/29, with changes to implement ISO/IEC JTC1/SC18/WG8 N1777). The normal output is not produced.-v,--versionβ print the version number.-wtype,--warning=typeβ control warnings and errors. Multiple-woptions are allowed. The following values of type enable warnings:xmlβ Warn about constructs that are not allowed by XML.mixedβ Warn about mixed content models that do not allow#PCDATAanywhere.sgmldeclβ Warn about various dubious constructions in the SGML declaration.shouldβ Warn about various recommendations made in ISO 8879 that the document does not comply with. (Recommendations are expressed with"should", as distinct from requirements which are usually expressed with"shall".)defaultβ Warn about defaulted references.duplicateβ Warn about duplicate entity declarations.undefinedβ Warn about undefined elements: elements used in the DTD but not defined.unclosedβ Warn about unclosed start and end-tags.emptyβ Warn about empty start and end-tags.netβ Warn about net-enabling start-tags and null end-tags.min-tagβ Warn about minimized start and end-tags. Equivalent to combination ofunclosed,emptyandnetwarnings.unused-mapβ Warn about unused short reference maps: maps that are declared with a short reference mapping declaration but never used in a short reference use declaration in the DTD.unused-paramβ Warn about parameter entities that are defined but not used in a DTD. Unused internal parameter entities whose text isINCLUDEorIGNOREwon't get the warning.notation-sysidβ Warn about notations for which no system identifier could be generated.allβ Warn about conditions that should usually be avoided (in the opinion of the author). Equivalent to:mixed,should,default,undefined,sgmldecl,unused-map,unused-param,emptyandunclosed.immediate-recursionβ Warn about immediately recursive elements. For more detais see clause 2.2.5 of Annex K of ISO 8879.fully-declaredβ Warn if the document instance fails to be fully declared. This has the effect of changing the SGML declaration to specifyIMPLYDEF ATTLIST NO ELEMENT NO ENTITY NO NOTATION NO. For more details see clause 2.2.1 of Annex K of ISO 8879.fully-taggedβ Warn if the document instance fails to be fully-tagged. This has the effect of changing the SGML declaration to specifyDATATAG NO,RANK NO,OMITTAG NO,SHORTTAG STARTTAG EMPTY NOandSHORTTAG ATTRIB OMITNAME NO. For more details see clause 2.2.2 of Annex K of ISO 8879.
Okay so the warning_type values keep going, and they are all giving βchange the SGML declarationβ energy:
amply-tagged,amply-tagged-recursiveβ Warn if the document instance fails to be amply-tagged. Implicitly defined elements may be immediately recursive ifamply-tagged-recursiveis specified. This has the effect of changing the SGML declaration to specifyDATATAG NO,RANK NO,OMITTAG NO,SHORTTAG ATTRIB OMITNAME NOand eitherIMPLYDEF ELEMENT ANYOTHERorIMPLYDEF ELEMENT YES. For more details see clause 2.2.4 of Annex K of ISO 8879.type-validβ Warn if the document instance fails to be type-valid. This has the effect of changing the SGML declaration to specifyVALIDITY YES. For more details see clause 2.2.3 of Annex K of ISO 8879.entity-refβ Warn about references to non-predefined entities. This has the effect of changing the SGML declaration to specifyENTITIES REF NONE. For more details see clause 2.3.2 of Annex K of ISO 8879.external-entity-refβ Warn about references to external entities. This includes references to an external DTD subset. This has the effect of changing the SGML declaration to specifyENTITIES REF INTERNAL. For more details see clause 2.3.3 of Annex K of ISO 8879.integralβ Warn if the document instance is not integrally stored. This has the effect of changing the SGML declaration to specifyENTITIES INTEGRAL YES. For more details see clause 2.3.1 of Annex K of ISO 8879.
And bestie, you can turn a warning off by putting no- in front of its name. So like -wall -wno-duplicate will enable all warnings except those about duplicate entity declarations. Slay. π
The following values for warning_type disable errors:
no-idrefβ Do not give an error for an ID reference value which no element has as its ID. The effect will be as if each attribute declared as an ID reference value had been declared as a name.no-significantβ Do not give an error when a character that is not a significant character in the reference concrete syntax occurs in a literal in the SGML declaration. This may be useful in conjunction with certain buggy test suites.no-validβ Do not require the document to be type-valid. This has the effect of changing the SGML declaration to specifyVALIDITY NOASSERTandIMPLYDEF ATTLIST YES ELEMENT YES. An option of-wvalidhas the effect of changing the SGML declaration to specifyVALIDITY TYPEandIMPLYDEF ATTLIST NO ELEMENT NO. If neither-wvalidnor-wno-validare specified, then theVALIDITYandIMPLYDEFspecified in the SGML declaration will be used.no-afdrβ Do not give errors when AFDR meta-DTD notation features are used in the DTD. These errors are normally produced when parsing the DTD, but suppressed when parsing meta-DTDs.-x,--referencesβ Show information about relevant clauses (from ISO 8879:1986) in error messages.
The following options are also supported for backward compatibility with sgmls:
-dβ Same as-wduplicate.-lβ Same as-oline.-msysidβ Same as-c.-rβ Same as-wdefault.-uβ Same as-wundef.
SEE ALSO π
ospent(1), ospam(1), onsgmlnorm(1), osx(1)
AUTHORS π
- James Clark β Author.
- Ian Castle <ian.castle@openjade.org> β Author.
COPYRIGHT π
Thatβs the legal vibe, bestie. No cap.
This whole page is OpenSP, November 2002, ONSGMLS(1) β periodt. π β¨π«Ά
π¦ where this page comes from
- alpine 3.22: opensp-doc 1.5.2-r6 Β· ICU
- alpine 3.23: opensp-doc 1.5.2-r6 Β· ICU
- alpine 3.24: opensp-doc 1.5.2-r6 Β· ICU
- arch rolling: opensp 1.5.2-11 Β· MIT
- centos-stream 10: opensp 1.5.2-48.el10 Β· X11
- centos-stream 9: opensp 1.5.2-38.el9 Β· MIT
- centos-stream 9: opensp 1.5.2-38.el9 Β· MIT
- fedora 43: opensp 1.5.2-49.fc43 Β· X11
- fedora 43: opensp 1.5.2-49.fc43 Β· X11
- fedora 44: opensp 1.5.2-50.fc44 Β· X11
- fedora 44: opensp 1.5.2-50.fc44 Β· X11
- nixos 26.05: opensp 1.5.2
- nixpkgs unstable: opensp 1.5.2
- opensuse-leap 16.0: opensp-doc 1.5.2-160000.2.2 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms