Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.5b

Application v 5.24b

  

 

Chapter ElevenSGML Functions (continued)

SGMLPullParameter Function

Overview

The SGMLPullParameter function “pulls” a parameter from the SGML Object and returns the data as a string value. The attribute or CSS property can be specified as a string or as a token.

Syntax/Parameters

Syntax

string = SGMLPullParameter ( 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 string containing the value for the specified attribute/property or an empty string on error. Because a value can legitimately be empty, the GetLastError or IsError function must be used to determine if an error occurs.

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 pull functions get the data and then mark the item as deleted. This can be useful in indicating a parameter has been processed.

For standard W3C defined attributes and properties, SDK defined token values can be referenced with the following standard prefixes:

HA_ — HTML attribute. for example, HA_ALIGN or HA_SIZE for “ALIGN=” or “SIZE=”

CP_ — CSS property, for example, CP_TEXT_ALIGN or CP_MARGIN_TOP for “text-align” or “margin-top”

Note that anywhere a dash ‘-’ is used in a name, it is replaced with an underbar ‘_’. See Appendix A — Legato SDK Standard Definitions for a complete list of definitions. For CSS properties, note that shorthand values are always converted to their constituent components, for example, “margin: 0pt” will have four properties for top, right, bottom and left.

If the internal value is a pvalue, it will automatically be converted to a string. Errors are converted to error strings.

Use caution when setting a pvalue type (or any numeric) variable from this function since Legato will automatically cast and convert the string to an integer which will not be in the correct format. The SGMLGetParameterValue function should be used to retrieve numeric values.

For HTML, all inline CSS styles parameters are automatically loaded and processed. The ‘STYLE’ attribute is not available for direct reading.

The SGMLGetParameterFlags function can be used to retrieve additional properties about the parameter.

Related Functions

Platform Support

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

Legato IDE, Legato Basic