TextServer
Company Structured Text Software Solutions Customers Support
Demonstrations Documentation Downloads Publications Acknowledgements



Table Functions

Table functions produce outputs that behave like tables. Thus table functions should occur in the from clause of SQL statements rather than the project list. Table functions may use inputs derived from earlier tables specified within the from list. The number of columns returned by a table function must be known prior to the SQL statement being executed.

Text Table Functions

The following table functions decompose input texts:

XPATH_TABLE(text / xpath)
Extracts from the input text those texts which match the xpath pattern, and for which columnar extraction is requested.

ISOLATE_SUBTEXTS(text)
Outputs a table having a single column. Each row will contain a single value in this column which corresponds to the input text. The nth row will have a text value which contains those marks which correspond to the the mark used to produce the nth subtree, together with the marks contained within this nth subtree. The subtree() function may subsequently be used to extract each subtree.

TEXT_FOREST(text)
The root of the input text may span a number of distinct subtrees. This table function converts the input text into one or more distinct texts each spanning one such subtree. If the input is null no rows are produced. If the text spans a single subtree one row is returned.

Grammar Table Functions

The following table functions provide access to the grammar associated with an external text, referenced via an internal text value.

GRAMMAR_ELEMENTS(text)
This table provides information about the elements and attributes in a text. The first two columns of this table form it's primary key. It contains:
  1. Name of the element or attribute
  2. Type of this item. Either Element or Attribute
  3. Informal description of item. This will be null if no such description has been added to the text using the comments.exe program.
  4. The number of occurrances of this item within the text. This will never be zero.

GRAMMAR_ENTITIES(text)
This table provides information about the entities in a text. A row is produced for every entity which occurs at least once in the text. The first column of this table forms it's primary key. It contains:
  1. The name of a generic entity in the grammar.
  2. The type of this entity
  3. The value of this entity
  4. The public identifier of this entity if any, else null
  5. The notation type of this entity
  6. The name of the notation associated with this entity if any

GRAMMAR_HIERARCHY(text)
This table describes the hierarchical relationship between elements and attributes in a text. The first four columns form its primary key. The first and second columns form a foreign reference to the corresponding grammar_elements table, as do the third and fourth columns. This table contains:
  1. Name of an ancestor item.
  2. Type of an ancestor item.
  3. Name of a descendant item.
  4. Type of a descendant item.
  5. Minimum number of occurances of descendant item under any instance of the named ancestor item
  6. Maximum number of occurances of descendant item under any instance of the named ancestor item. This will never be 0.
  7. Minimum number of descendant items which are children under any instance of the named ancestor item
  8. Maximum number of descendant items which are children under any instance of the named ancestor item
  9. Minimum number of descendant items which are not children under any instance of the named ancestor item
  10. Maximum number of descendant items which are not children under any instance of the named ancestor item

Namespace table functions

The XPath specification allows for a namespace axis, describing the set of active namespaces that conceptually are associated with a given element. Namespace nodes bear no relationship to the original text, and have very different semantics from all other nodes in a text. In addition the xpath specification provides only limited information about these namespace nodes.

Textserver replaces the namespace axis defined in Xpath with two table functions, which may if desired be employed within Xpath predicates. This makes the semantics of Xpath clearer, while increasing the potential for working with namespaces.

NAMESPACE_BINDINGS(text)
Describes the namespace bindings that occur in the text. This table contains:
  1. A unique sequential identifier.
  2. The namespace prefix associated with this namespace. (May be an empty string).
  3. The namespace URI associated with this namespace. (May be an empty string).
  4. The canonical representation of the URI. (May be an empty string).
  5. The node number in the text which contains this binding.
  6. The number of subordinate nodes spanned by this nodespace definition.
  7. The sum of the node number and span thus provide the last node number within the text for which this nodespace definition is active.

NAMESPACE_HIERARCHY(text)
This produces a 6 column table having the same format as the NAMESPACE_BINDINGS table. However, only namespaces which actively apply to the root of the provided text are reported. Thus each row in this table corresponds precisely to a single namespace node within the Xpath specification.

Other Table Functions

TEXT_FILES(string1,string2...)
Matches system files against each of the specified strings, producing a row for each system file found which matches any of the input strings. Each string begins with an absolute or relative pathname, and ends with a filename that alone may be wildcarded with '*' to match zero or more characters and '?' to match zero or one. If the filename is prefixed with '//' then the filename may occur at or recursively under the specified directory. This table containing:
  1. Full file name.
  2. Abbreviated DOS file name.
  3. Size of the file in bytes.
  4. Creation date and time of this file.
  5. Last modified date and time of this file.
  6. Last accessed date and time of this file.
(See also FILE_TO_TEXT).

For security reasons the only files that this function may describe are those having file extensions described in the value of the registry key:
HKEY_LOCAL_MACHINE\SOFTWARE\Dealers Choice Software\TextServer\FileTypes\Text.
Multiple extensions can be specified separated by whitespace. Extensions are considered to match a file name if they match (ignoring case) the end of the filename. As a special case '*' matches every file. An absent or empty key match no files.

STRING_FILES(string1,string2...)
Behaves exactly like TEXT_FILES. (See also FILE_TO_STRING). For security reasons the only files that this function may describe are those having file extensions described in the value of the registry key:
HKEY_LOCAL_MACHINE\SOFTWARE\Dealers Choice Software\TextServer\FileTypes\String.

Maintainer
webmaster@textserver.com
Back