Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.5d

Application v 5.25a

  

 

Chapter ElevenSGML Functions (continued)

HTMLToXHTML Function

Overview

The HTMLToXHTML function takes an input stream of HTML code and conforms the tagging XHTML.

Syntax/Parameters

Syntax

string = HTMLToXHTML ( handle hData | string data, dword options], [handle log] );

Parameters

hData or data

A handle to a SGML Object, Mapped Text or Edit Object. Or,

A string containing HTML code;

options

An optional dword specifying conformance flags. The default value is 0x00000000, see Remarks.

log

An optional handle to a Log Object to receive any errors or warnings.

Return Value

A string containing the conformed code, a message or an empty string on error. Use the GetLastError function to retrieve a formatted error code.

Remarks

The HTMLToXHTML function takes a source HTML code base and attempts to conform it XHTML. The function reads each tag and character entity and then writes an adjusted version back to the output string. In addition, the code can be tidied for conformed line endings and width.

Errors are normalized and HTML attributes promoted to CSS as appropriate. If a log is provided, errors and warnings are dumped to the log. Certain deprecated tags are automatically updated as required. For example, <FONT> is replaced with <span>.

Flags are as follows:

  SDK Definition   Bitwise   Description  
  General          
    HTX_ALL_OPTIONS   0xFFFFFFFF   All Options On  
  Tidy        
    HTX_TIDY_CODE_BREAKS   0x00000001   Tidy Code Breaks (blocks)  
    HTX_TIDY_CODE_LINE_ENDINGS   0x00000002   Tidy Code Line Endings  
    HTX_TIDY_CODE_WRAP   0x00000004   Wrap the Code  
  HTML Errors        
    HTX_REPORT_TAG_ERRORS    0x00000010   Report Tag Errors to Log   
    HTX_REPORT_CSS_ERRORS    0x00000020   Report CSS Errors to Log   
    HTX_REPORT_NESTING_ERRORS    0x00000040   Report Nesting Errors to Log   
  HTML          
    HTX_NO_HEADER   0x00000100   No Header or Footer  
  EDGAR          
    HTX_MX_REMOVE_EDGAR_TAGS   0x00001000   Remove Revisions, Page etc.  
    HTX_UPDATE_EDGAR_R_TAGS    0x00002000   Update Revisions to -sec-ix-redline  

 

Note that the HTX_MX_REMOVE_EDGAR_TAGS option also converts ^ characters to entities, as required by the EDGAR System.

Related Functions

Platform Support

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

Legato IDE, Legato Basic