|
The Sgmlconv Utility
The Open SiteSearch
Database Builder sgmlconv utility program allows you to convert
Standard Generalized Markup Language (SGML) or other tagged data into
ASN.1/BER encoded records that can be added to a SiteSearch database.
This utility may be used specifically to help create
a database tag definition (.dtd) file, a standard text file that serves
as an interpreter between SGML files and sgmlconv. Refer to the
syntax described below to run the utility from the UNIX command prompt
within your database dbs directory. If you are creating a .dtd
file from sgmlconv, make sure to include option -a when
you run the utility.
Refer to Introduction to Using SGML Source Data to Build a Database for more information about SGML.
Syntax
Use the following syntax to execute the sgmlconv utility from the UNIX prompt.
sgmlconv [dbname] [-ddtdfile] [-iinputfile] [-ooutputfile] [-mmaxrecs] [-sskiprecs] [-allowNewTags] [-previousTaggingStyle] [-rrecordtag] [-fdebug] [-gmsgsoutputfile] [-h]
Parameters
|
Description
|
dbname
|
Contains the default filename prefix for the database (e.g., ERIC) that will be used to create filenames of any of the other filename parameters not specified. The default suffix for the input filename is .sgml (e.g., ERIC.sgml), .ber for the output filename (e.g., ERIC.ber), and .dtd for the dtd file name is (e.g., ERIC.dtd).
Note: |
dbname must be provided if any of the other parameters are omitted.
|
|
-ddtdfile
|
Specifies the name of the file containing the database tag definitions (.dtd).
|
-iinputfile
|
Specifies the name of the file containing the SGML records to be converted to ASN.1/BER format (.sgml).
|
-ooutputfile
|
Specifies the name of the file to contain the ASN.1/BER encoded records (.ber).
|
-mmaxrecs
|
Specifies the maximum number of records in the inputfile to process.
|
-sskiprecs
|
Specifies the maximum number of records in the inputfile to skip before conversion begins.
|
-allowNewTags
|
Creates a simple default .dtd file based on your data. This .dtd file does not have any nested terms and is outputted to the name sgmlconv.dtd.
|
-previousTaggingStyle
|
Without
this flag, sgmlconv organizes the BER data for each record so that
the data in each subfield has an explicit tag of its own (/1) underneath
the subfield's tag.
With this
flag, sgmlconv operates as it did in previous SiteSearch versions.
It does not create a separate tag level for the data in a subfield.
In addition, a field can contain either data or subfields, but not
both.
|
-rrecordtag
|
Specifies the tag and recordtag that define the beginning of a database record. The defaults are <rec>, <reprec>, and <delrec>.
|
-fdebug
|
Allows you to debug a database's .dtd and .sgml files. Set the debug variable equal to the database name.
Note: |
The .dtd and .sgml files must be located in the current directory and have the following values for the debugger to work: dbname.dtd and dbname.sgml, where dbname is the database name and the value of debug.
|
|
-gmsgsoutputfile
|
Contains the name of the optional output file for program messages.
|
-h
|
Displays the utility's usage statement for additional help.
|
Examples
The example below shows how to convert SGML records for a database called phone and store the ASN.1/BER output in the current directory.
Notice that the name of the database is included in the example above, but the name of the SGML input file, the .dtd file, and the ASN.1/BER output file are excluded. By default, sgmlconv will use the database name in the value of the input file, .dtd file, and output file, unless otherwise defined. In the example above, the default input file name would be phone.sgml, the default .dtd file name would be phone.dtd, and the default output file name would be phone.ber. You could also issue the following command that would have the same result:
sgmlconv -dphone.dtd -iphone.sgml -ophone.ber
|
The following example converts SGML records in the directory /home/zeus and stores the resultant records in the current directory.
sgmlconv /home/zeus/phone -ophone.ber
|
Note: |
When sgmlconv
encounters SGML tags that are not described in the .dtd file, it
treats them as textual data.
|
The ber2txt
utility can be used to view the contents of an ASN.1/BER record in
human-readable format.
See Also
OCLC
SiteSearch Database Builder Utility Programs
Introduction to Using SGML Source Data to
Build a Database
Creating a Database Tag Definition (.dtd)
File
Creating a New SiteSearch Database
The Ber2txt Utility
ISO 8825, Specification of Basic Encoding Rules for Abstract Syntax Notation
One (ASN.1)
|