Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.5d

Application v 5.25a

  

 

Chapter ElevenSGML Functions (continued)

HTMLConformCode Function

Overview

The HTMLConformCode function takes an input stream of HTML code and conforms the tagging to a specific DTD.

Syntax/Parameters

Syntax

string = HTMLConformCode ( handle hData | string data, int dtd_type,
                      [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;

dtd_type

An int specifying the DTD to which to conform the code. See Section 11.3.10 DTD and Schema for a list of codes.

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.

If a string is provided as the source data, the return value will be the updated string. For objects, the returned string will be “[written back to object]” on success.

Remarks

The HTMLConformCode function takes a source HTML code base and partially conforms it to a specified DTD. The function reads each tag and character entity and then writes an adjusted version back to the output string. The structure of the code and the formatting is not altered.

Errors are normalized and HTML attributes promoted to CSS as appropriate. If a log is provided, errors and warnings are dumped to the log.

The options parameter can be set to HCC_ADD_DTD_HEADER to force a DTD and header as required.

Tag nesting and structured are not adjusted or processed.

Related Functions

Platform Support

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

Legato IDE, Legato Basic