Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.6a

Application v 6.0a

  

 

Chapter ElevenSGML Functions (continued)

SGMLGetParameterFlags Function

Overview

The SGMLGetParameterFlags function returns the parsing flags for a specified attribute or property.

Syntax/Parameters

Syntax

dword = SGMLGetParameterFlags ( handle hSGML, TOKEN token | string property );

Parameters

hSGML

A handle to an SGML Object.

token

An optional TOKEN (dword) as a token value for an attribute or CSS property. The token must be defined in the DTD. Or,

property

An optional string specifying a text version of the attribute or CSS property. The property is tested as an attribute and then as a CSS property name. If not found in the DTD, an error is returned. Either the token or property parameter must be provided.

Return Value

A dword containing the flags or a formatted error code on failure.

If the property name cannot be translated, the value 0x1002 will be ORed bitwise with the error code.

Remarks

An element must be selected in the SGML Object to have any parameters loaded or modified using the SGMLNextElement, SGMLPreviousElement or SGMLSetParameter functions.

The parameter flags relay information regarding the parsing or state of particular attribute or property. Actions after an element has been loaded will also set or reset flags depending on the process. For example, normalizing HTML to CSS will set flags on HTML attributes that have been promoted to CSS properties.

The bitwise flags are as follows:

  Definition   Bitwise   Description  
  General          
    SGML_PE_PARAMETER_OK_MASK   0x000003FF   No Errors or Remove Mask (0 = OK)  
    SGML_PE_ERROR   0x00000001   Error in Entry (General)  
    SGML_PE_OUT_OF_CONTEXT   0x00000002   The Attribute not in DTD for Element  
    SGML_PE_UNKNOWN_ATTRIBUTE   0x00000004   The Attribute was not in the DTD  
    SGML_PE_UNKNOWN_PROPERTY   0x00000008   The CSS Properties is Unknown  
    SGML_PE_DELETED   0x00000010   This Item Has Been Deleted  
    SGML_PE_RESERVED   0x00000020   (Bit is Available as Error)  
  CSS          
    SGML_PE_CSS_FLAGS_MASK   0x000FC000   Mask for CSS Flags  
    SGML_PE_CSS_CONFLICT   0x00004000   Attribute Conflict with CSS†  
    SGML_PE_CSS_OVERRIDE   0x00008000   Value Moved to CSS Property  
    SGML_PE_CSS_IMPORTANT   0x00010000   !Important Term Was Used  
    SGML_PE_CSS_VALUE_PROCESSED   0x00020000   Value was Processed, ie url()  
    SGML_PE_CSS_EMBEDDED_DATA   0x00040000   Contains Embedded Data  
  Format          
    SGML_PE_CSS_FORMAT_MASK   0x03F00000   Mask for Format Flags  
    SGML_PE_PRECEED_BY_RETURN   0x00100000   The Attribute was on a New Line  
    SGML_PE_VALUE_QUOTED   0x00200000   The Attribute/Value was Quotes (HTML)  
    SGML_PE_NO_SPACE_ON_EMPTY_ELEMENT   0x00400000   No Leading Space on Empty Element  
  Control          
    SGML_PE_CSS_CONTROL_MASK   0xFC000000   CSS Control Mask  
    SGML_PE_CSS_MARKED   0x04000000   General Marking Flag†  
    SGML_PE_CSS_DERIVED_FROM_SHORTHAND   0x08000000   Value Came from CSS Shorthand  
    SGML_PE_CSS_PROMOTED_FROM_MSO   0x10000000   Was Promoted from MSO (no detail)†  
    SGML_PE_CSS_CONFLICT_WITH_MSO   0x20000000   Conflicted with MSO (no detail)†  

 

The dagger (†) indicates that the flag will only be set if an additional processing action has been taken. A double dagger (‡) indicates that when set, the attribute or property cannot be accessed by this function.

MSO (Microsoft Office) employs a series of CSS properties that can be promoted by certain operations to standard CSS properties.

When using a string as a property name, adding a ‘+’ prefix will force the value to be a CSS property and to ignore the HTML attribute names.

Related Functions

Platform Support

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

Legato IDE, Legato Basic

Page revised 2025-03-13