Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.5d

Application v 5.25a

  

 

Chapter ElevenSGML Functions (continued)

11.6 The HTML Outline Object

11.6.1 General

The Outline object will scan a file or object containing HTML and make a map of blocks, headings and tables. In addition, table content can be scanned.

11.6.2 Basic Operation

An object can be created by calling the OutlineCreateObject function which can also scan or map the HTML at the same time. Alternatively, an object can be created and later loaded with data and scanned by using the OutlineSetFile or OutlineSetObject functions.

By default, table content is not mapped. It is assumed that tables are treated as complete blocks whose content can be independently mapped. Tables can be mapped by setting the HO_MAP_TABLE_CONTENT option during the initial scan.

The scanning flags are as follows (combine as OR):

  Definition   Bitwise   Comment  
  Item Options          
    HO_MAP_EMPTY_BLOCKS   0x00010000   Map Empty Blocks  
    HO_MAP_ABS_POSITIONS   0x00020000   Add in Absolute Position  
    HO_MAP_TABLE_CONTENT   0x00080000   Map Table Content  
    HO_MAP_MAP_IDS   0x00100000   Map IDs  
    HO_MAP_MAP_KEYWORDS   0x00200000   Map Keyword (word array)  
    HO_MAP_MAP_FIELD_SET   0x00400000   Map SGML Fields Set Variables  
  Keyword Options          
    HO_MAP_KEYWORD_NUMBERS   0x00000001   Numbers  
    HO_MAP_KEYWORD_DATES   0x00000002   Dates  
    HO_MAP_KEYWORD_CARDINAL   0x00000004   Cardinal Numbers  

 

As items are discovered, they are added to the outline map which can be accessed by an index position. Each mapped item will have a type which can be retrieved from the map by using the OutlineGetItemType function. The types are as follows:

  Definition   Bitwise   Comment  
  Basic Types          
    HO_TYPE_MASK   0x00FF0000   Type Mask  
    HO_TYPE_UNKNOWN   0x00000000   Unknown Type  
    HO_TYPE_EMPTY   0x00010000   Empty  
    HO_TYPE_BLOCK_GENERAL   0x00020000   General Block (unknown)  
    HO_TYPE_HEADING   0x00030000   Heading  
    HO_TYPE_PARAGRAPH   0x00040000   Paragraph  
    HO_TYPE_LIST   0x00050000   List Item  
    HO_TYPE_TABLE_GENERAL   0x00060000   Table General/Unknown  
    HO_TYPE_PAGE_BREAK   0x000B0000   Page Break  
    HO_TYPE_FIELD_SET   0x000C0000   Field Set  
    HO_TYPE_ID_GROUP   0x000F0000   Specifies a Named Position  
    HO_TYPE_TABLE_CELL   0x00100000   Table Cell (Table Content Only)‡  
  Align Mode          
    HO_TYPE_MODE_MASK   0x0000000F   Alignment type mask  
    HO_TYPE_MODE_LEFT   0x00000001   Left  
    HO_TYPE_MODE_RIGHT   0x00000002   Right  
    HO_TYPE_MODE_CENTER   0x00000003   Center  
    HO_TYPE_MODE_JUSTIFY   0x00000004   Justify  

 

‡  Only when table content is mapped. 

11.6.3 Functions

OutlineCreateObject — Creates an Outline Object either as empty or from a file, Mapped Text or Edit Object.

OutlineGetString — Returns the outline string for entry.

OutlineSetFile — Maps the contents of a specified file into the Outline Object.

OutlineSetObject — Maps the content of a specified object into the Outline Object.

OutlineGetItemColumn — Gets the column for the specified item.

OutlineGetItemCount — Returns the count of outline items.

OutlineGetItemHTML — Gets the text of an item as the source HTML.

OutlineGetItemPosEX — Gets the ending X position of entry data.

OutlineGetItemPosEY — Gets the ending Y position of entry data.

OutlineGetItemPosSX — Gets the starting X position of entry data.

OutlineGetItemPosSY — Gets the starting Y position of entry data.

OutlineGetItemRow — Gets the row for the specified item.

OutlineGetItemSpan — Gets the span value for a cell.

OutlineGetItemText — Gets the text of an outline entry.

OutlineGetItemType — Returns the coded type of an item and its characteristics.