|
Lines 412-434
Link Here
|
| 412 |
<para>Try to validate this file using an SGML parser.</para> |
412 |
<para>Try to validate this file using an SGML parser.</para> |
| 413 |
|
413 |
|
| 414 |
<para>Part of <filename role="package">textproc/docproj</filename> is the |
414 |
<para>Part of <filename role="package">textproc/docproj</filename> is the |
| 415 |
<command>nsgmls</command> <link linkend="sgml-primer-validating">validating |
415 |
<command>onsgmls</command> <link linkend="sgml-primer-validating">validating |
| 416 |
parser</link>. Normally, <command>nsgmls</command> reads in a document |
416 |
parser</link>. Normally, <command>onsgmls</command> reads in a document |
| 417 |
marked up according to an SGML DTD and returns a copy of the |
417 |
marked up according to an SGML DTD and returns a copy of the |
| 418 |
document's Element Structure Information Set (ESIS, but that is |
418 |
document's Element Structure Information Set (ESIS, but that is |
| 419 |
not important right now).</para> |
419 |
not important right now).</para> |
| 420 |
|
420 |
|
| 421 |
<para>However, when <command>nsgmls</command> is given the <option>-s</option> |
421 |
<para>However, when <command>onsgmls</command> is given the <option>-s</option> |
| 422 |
parameter, <command>nsgmls</command> will suppress its normal output, and |
422 |
parameter, <command>onsgmls</command> will suppress its normal output, and |
| 423 |
just print error messages. This makes it a useful way to check to |
423 |
just print error messages. This makes it a useful way to check to |
| 424 |
see if your document is valid or not.</para> |
424 |
see if your document is valid or not.</para> |
| 425 |
|
425 |
|
| 426 |
<para>Use <command>nsgmls</command> to check that your document is |
426 |
<para>Use <command>onsgmls</command> to check that your document is |
| 427 |
valid:</para> |
427 |
valid:</para> |
| 428 |
|
428 |
|
| 429 |
<screen>&prompt.user; <userinput>nsgmls -s example.sgml</userinput></screen> |
429 |
<screen>&prompt.user; <userinput>onsgmls -s example.sgml</userinput></screen> |
| 430 |
|
430 |
|
| 431 |
<para>As you will see, <command>nsgmls</command> returns without displaying any |
431 |
<para>As you will see, <command>onsgmls</command> returns without displaying any |
| 432 |
output. This means that your document validated |
432 |
output. This means that your document validated |
| 433 |
successfully.</para> |
433 |
successfully.</para> |
| 434 |
</step> |
434 |
</step> |
|
Lines 438-448
Link Here
|
| 438 |
removing the <sgmltag>title</sgmltag> and |
438 |
removing the <sgmltag>title</sgmltag> and |
| 439 |
<sgmltag>/title</sgmltag> tags, and re-run the validation.</para> |
439 |
<sgmltag>/title</sgmltag> tags, and re-run the validation.</para> |
| 440 |
|
440 |
|
| 441 |
<screen>&prompt.user; <userinput>nsgmls -s example.sgml</userinput> |
441 |
<screen>&prompt.user; <userinput>onsgmls -s example.sgml</userinput> |
| 442 |
nsgmls:example.sgml:5:4:E: character data is not allowed here |
442 |
onsgmls:example.sgml:5:4:E: character data is not allowed here |
| 443 |
nsgmls:example.sgml:6:8:E: end tag for "HEAD" which is not finished</screen> |
443 |
onsgmls:example.sgml:6:8:E: end tag for "HEAD" which is not finished</screen> |
| 444 |
|
444 |
|
| 445 |
<para>The error output from <command>nsgmls</command> is organized into |
445 |
<para>The error output from <command>onsgmls</command> is organized into |
| 446 |
colon-separated groups, or columns.</para> |
446 |
colon-separated groups, or columns.</para> |
| 447 |
|
447 |
|
| 448 |
<informaltable frame="none" pgwide="1"> |
448 |
<informaltable frame="none" pgwide="1"> |
|
Lines 458-464
Link Here
|
| 458 |
<row> |
458 |
<row> |
| 459 |
<entry>1</entry> |
459 |
<entry>1</entry> |
| 460 |
<entry>The name of the program generating the error. This |
460 |
<entry>The name of the program generating the error. This |
| 461 |
will always be <literal>nsgmls</literal>.</entry> |
461 |
will always be <literal>onsgmls</literal>.</entry> |
| 462 |
</row> |
462 |
</row> |
| 463 |
|
463 |
|
| 464 |
<row> |
464 |
<row> |
|
Lines 483-490
Link Here
|
| 483 |
message, <literal>W</literal> is for warnings, and |
483 |
message, <literal>W</literal> is for warnings, and |
| 484 |
<literal>E</literal> is for errors<footnote> |
484 |
<literal>E</literal> is for errors<footnote> |
| 485 |
<para>It is not always the fifth column either. |
485 |
<para>It is not always the fifth column either. |
| 486 |
<command>nsgmls -sv</command> displays |
486 |
<command>onsgmls -sv</command> displays |
| 487 |
<literal>nsgmls:I: SP version "1.3"</literal> |
487 |
<literal>onsgmls:I: SP version "1.3"</literal> |
| 488 |
(depending on the installed version). As you can see, |
488 |
(depending on the installed version). As you can see, |
| 489 |
this is an informational message.</para> |
489 |
this is an informational message.</para> |
| 490 |
</footnote>, and <literal>X</literal> is for |
490 |
</footnote>, and <literal>X</literal> is for |
|
Lines 512-518
Link Here
|
| 512 |
|
512 |
|
| 513 |
<para>The second error is because <sgmltag>head</sgmltag> elements |
513 |
<para>The second error is because <sgmltag>head</sgmltag> elements |
| 514 |
<emphasis>must</emphasis> contain a <sgmltag>title</sgmltag> |
514 |
<emphasis>must</emphasis> contain a <sgmltag>title</sgmltag> |
| 515 |
element. Because it does not <command>nsgmls</command> considers that the |
515 |
element. Because it does not <command>onsgmls</command> considers that the |
| 516 |
element has not been properly finished. However, the closing tag |
516 |
element has not been properly finished. However, the closing tag |
| 517 |
indicates that the element has been closed before it has been |
517 |
indicates that the element has been closed before it has been |
| 518 |
finished.</para> |
518 |
finished.</para> |
|
Lines 894-906
Link Here
|
| 894 |
<procedure> |
894 |
<procedure> |
| 895 |
<step> |
895 |
<step> |
| 896 |
<para>Add some comments to <filename>example.sgml</filename>, and |
896 |
<para>Add some comments to <filename>example.sgml</filename>, and |
| 897 |
check that the file still validates using <command>nsgmls</command>.</para> |
897 |
check that the file still validates using <command>onsgmls</command>.</para> |
| 898 |
</step> |
898 |
</step> |
| 899 |
|
899 |
|
| 900 |
<step> |
900 |
<step> |
| 901 |
<para>Add some invalid comments to |
901 |
<para>Add some invalid comments to |
| 902 |
<filename>example.sgml</filename>, and see the error messages that |
902 |
<filename>example.sgml</filename>, and see the error messages that |
| 903 |
<command>nsgmls</command> gives when it encounters an invalid comment.</para> |
903 |
<command>onsgmls</command> gives when it encounters an invalid comment.</para> |
| 904 |
</step> |
904 |
</step> |
| 905 |
</procedure> |
905 |
</procedure> |
| 906 |
</sect2> |
906 |
</sect2> |
|
Lines 1049-1055
Link Here
|
| 1049 |
</step> |
1049 |
</step> |
| 1050 |
|
1050 |
|
| 1051 |
<step> |
1051 |
<step> |
| 1052 |
<para>Validate the document using <command>nsgmls</command>.</para> |
1052 |
<para>Validate the document using <command>onsgmls</command>.</para> |
| 1053 |
</step> |
1053 |
</step> |
| 1054 |
|
1054 |
|
| 1055 |
<step> |
1055 |
<step> |