Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.4j

Application v 5.22b

  

 

Chapter FiveGeneral Functions (continued)

GetTagTextContent Function

Overview

The GetTagTextContent function gathers text until an SGML tag is encountered. It uses a Word Parse Object that must be setup for tag parsing.

Syntax/Parameters

Syntax

string = GetTagTextContent ( handle hWordParse, [dword flags] );

Parameters

hWordParse

A handle to a Word Parse Object that has been setup for parsing SGML tags.

flags

An optional dword specifying one or more flags for collecting the text. The default value is 0x00000000.

Return Value

Returns a string containing all of the text until a tag was encountered or the source string was exhausted. Use the GetLastError function to retrieve error information.

If there are character translation errors, the last error will contain the number of errors. It is up to the caller to determine the nature and position of the errors.

On overflow, ERROR_OVERFLOW, the low word will be 0x0000 for a destination buffer overflow (> 2mb) or 0x0001 for a word buffer overflow. The word buffer is, by default, 4kb, if the data contains encoded information such as base-64, use the WP_BIG_WORD_BUFFER option during the creation of the Word Parse Object.

Remarks

This function is a “quick and dirty” method of retrieving content from SGML tagged information without the complexity of setting up an SGML element object or a DTD. Very little error and syntax checking is performed.

Data collection starts are the current position for the Word Parse Object and continues until the source information is exhausted or an SGML tag is encountered. The parse position is left at the start of the SGML tag. How the text is processed is controlled by the following flags:

  SDK Define   Bitwise   Description  
  SGML_CT_RAW_SPACE   0x00000001   Collect all spaces, not just a word space for white space.  
  SGML_CT_TRANSLATE_ENTITIES   0x00000002   Translate Character Entities  
  SGML_CT_TRANSLATE_HTML_NAMES   0x00000004   Translate HTML Entity Names  
  SGML_CT_TRANSLATE_TO_UTF   0x00000010   Translate to UTF  

 

Related Functions

Platform Support

Go13, Go16, GoFiler Complete, GoFiler Corporate, GoFiler, GoFiler Lite, GoXBRL

Legato IDE, Legato Basic