Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.5b

Application v 5.24b

  

 

Chapter ElevenSGML Functions (continued)

SGMLGetParameters Function

Overview

The SGMLGetParameters function returns an array of parameters as string values.

Syntax/Parameters

Syntax

string[] = SGMLGetParameters ( handle hSGML, [int mode] );

Parameters

hSGML

A handle to an SGML Object.

mode

An optional int which specifies the mode or style in which the information is returned. It can be SGML_GP_HTML or SGML_GP_XML, the default is SGML_GP_HTML. See Remarks below.

Return Value

A string array containing the value for each attribute/property or empty if there are no attributes or parameter or an empty set on error. Because a value can legitimately be empty, the GetLastError or IsError function must be used to determine if an error occurred. Coding errors contained in the parsed item error do not result in an error from the function.

Remarks

SGMLGetParameters allows for the quick return of element data in the form of a list. It cannot and does not have the ability to return all the information associated with each element parameter. Other parameter functions allow for more detailed access.

The array is formed with each entry as the attribute or CSS property with the key name and the string as the translated value. In HTML mode, the key name will be uppercase for attributes and lower case for CSS. Namespaces are not required. In XML mode, the attribute is returned as spelled in the DTD, CSS properties are not generally accepted.

Attribute/property names are placed in the key name portion of the array and array elements are case-sensitive. This can cause a problem when attempting to access an entry, for example, aa["align"] which is different and unique as compared to aa["ALIGN"]. For XML these are two separate and distinct entries. For HTML, they are the same. The optional mode parameters allows attributes to always be passed back as uppercase or to be case-sensitive. For CSS properties, they are always lower case.

If the attribute name is not in the DTD, it will be placed in brackets.

Values are translated to strings and may include error information. Further, certain PT_ values may not translate.

An element must be selected in the SGML Object to have any parameters loaded or modified using the SGMLNextElement, SGMLPreviousElement or SGMLSetParameter functions. SGMLNextItem will either load an element with parameters or clear the parameters depending on whether a tag was parsed.

Related Functions

Platform Support

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

Legato IDE, Legato Basic