Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.6d

Application v 6.1b

  

 

Chapter FiveGeneral Functions (continued)

XMLParseGetItem Function

Overview

The XMLParseGetItem function grabs the next item and processes the text if the item is a tag.

Syntax/Parameters

Syntax

string = XMLParseGetItem ( handle hXPO, [boolean raw] );

Parameters

hXPO

handle specifying an XML Parse Object.

raw

An optional boolean value specifying whether to return the raw data. The default value is FALSE, which processes tags.

Return Value

Returns a string containing the next parsed item or an empty string on failure. Use the GetLastError function to retrieve error information.

On error, if the formatted error code is ERROR_SYNTAX, the offending character position within the tag will be in the low word of the error code.

Remarks

An empty string generally means the parser has reached the end of the data. Use the GetLastError function to determine if the end of data has been reached (ERROR_EOD) or some other error prevented the function from completing.

Syntax errors will return the item to the point of the error. Note that only gross errors are detected.

The parser moves forward and collects white space within its buffer and can be retrieved using the XMLParseGetSpace function. Once text is discovered, the position is noted and if not a tag, the parser will collect data until the next word space. If the parsed item is a tag (starts with a ‘<’ character), the tag is collected until an unprotected ‘>’ tag is encountered.

By default, the XMLParseGetItem will capture the next parsed item and, if it is a tag, the item will be further processed (cracking the tag) to pull the element, prefix, concept, attributes and namespaces. When processed, the returned buffer will return the element and the first attribute.

If the raw is set to FALSE (or default), each component of the tag can be retrieved. Use the XMLParseGetConcept function to get the concept, XMLParseGetPrefix to get the local part of the element qname, XMLParseGetElement to get the unprocessed element/qname and the XMLParseGetAttributes function to return the attributes.

If the raw is set to TRUE, the parse item is simply returned.

For non-tags (text and character entities), the item is returned as is.

Related Functions

Platform Support

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

Legato IDE, Legato Basic

Page revised 2025-08-15