Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.5d

Application v 5.25a

  

 

Chapter ElevenSGML Functions (continued)

SGMLWriteTag Function

Overview

The SGMLWriteTag function renders the current SGML element to a string and writes it back to the location from which it was parsed.

Syntax/Parameters

Syntax

int = SGMLWriteTag ( handle hSGML );

Parameters

hSGML

A handle to an SGML Object.

Return Value

An int as a formatted error code.

Remarks

The SGMLWriteTag function requires a tag position to be internally saved from a previous parse action which occurs anytime a tag is parsed. If the referenced file is edited prior to writing back a tag, the file could be corrupted.

If an Edit Object or Edit View is employed while creating the SGML Object, the parse position will be adjusted to the end of the newly written tag.

To update a tag at a known position, the SGMLNextElement function can be used by specifying the start position of the tag. A subsequent call to the SGMLWriteTag function will automatically replace the tag at the parsed position.

When writing a series of tags, for example when mapping a number of elements within a document, it is recommended that the read and update functions be performed while walking backwards or up the file. In this manner, if a tag changes the position of existing mapped items, it will not disturb the position items that have not been processed.

Related Functions

Platform Support

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

Legato IDE, Legato Basic