tsml2sqlite(1)          FreeBSD General Commands Manual         tsml2sqlite(1)

     TMSL to SQLite - converts TSML documents to Sqlite Databases.

     tsml2sqlite [-f <filename>]

     The tsml2sqlite utility converts a TSML document into a SQLite database.
     The tsmlquery(1) munger module provides functions to query databases.
     TSML is defined in tsml(5).

     By default, the database is created in the current working directory and
     is named tsml.db.  A different path and filename can be specified with
     the -f command line option.

     The TSML table contains records representing the TSML document.  Records
     in the TSML table have four columns:

     index   contains a unique natural number identifier for each record.

     path    describes the record's hierarchical relationship to the rest of
             the document.  The path field resembles a filesystem path.  The
             paths in a TSML document are not unique.

     data    contains document text if the record describes a segment of
             document data or the empty string otherwise.

     parent  contains the index field of the record's parent element or 0 if
             the record represents the toplevel element.

     Consider the following simple TSML document:


     After parsing by tsml2sqlite, the following TSML table will have been

     index           path            data        parent
     -----           ----            ----        ------
     1               \TSML           ''          0
     2               \TSML\          blather     1
     3               \TSML\inner     ''          1
     4               \TSML\inner\    booger      3
     5               \TSML\          blather     1

     Records that represent elements have path fields that do not end with a
     backslash and have empty data fields.  Records that represent document
     data have path fields that end with a backslash and have non-empty data

     Record 1 represents the TSML element.  The data column for this element
     is the empty string because it represents the element itself and not its
     content.  Record 1's parent element is set to 0 to indicate that record 1
     is a toplevel element.

     Record 2's path field is identical to record 1's except for the addition
     of a trailing backslash.  Record 2 represents the first segment of
     document data in the TSML element.  The data field contains the text

     Record 3 represents the inner element.  Record 4 represents the document
     data of the inner element.  Record 5 represents the second segment of
     document data in the TSML element.

     James Bailie <jimmy@mammothcheese.ca>

                               Wed Nov 22, 2017