Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.5d

Application v 5.25a

  

 

Chapter ElevenSGML Functions (continued)

SGMLGetItemResult Function

Overview

The SGMLGetItemResult function returns status and error data for the last item parsed.

Syntax/Parameters

Syntax

dword = SGMLGetItemResult ( handle hSGML );

Parameters

hSGML

A handle to an SGML Object.

Return Value

Returns a 32-bit dword result code using bitwise flags. On error, a formatted error code will be returned and can also be retrieved using the GetLastError function. Note that the top 4-bits of the result are always zero so as to not conflict with the formatted error code.

Remarks

The bitwise result codes are as follows:

  Define   Bitwise Value   Description  
  Error Indicators (Bitwise AND)          
    SPI_RC_ERROR_MASK   0x0FFFF000   Mask for Errors  
    SPI_RC_ERROR_NON_ATTRIBUTE_MASK   0x0F9FF000   Mask for Errors (no attribute errors)  
  DTD Error Codes        
    SPI_RC_ERROR_ELEMENT_NOT_IN_DTD   0x00001000   Element not in DTD  
    SPI_RC_ERROR_NAMESPACE_NOT_IN_DTD   0x00002000   Namespace not in DTD  
  General Errors          
    SPI_RC_OVERFLOW   0x00010000   Item Overflowed Buffer  
    SPI_RC_ENTITY_ERROR   0x00020000   Character Entity Had Error (space)  
    SPI_RC_TAG_ERROR   0x00040000   SGML Tag Error  
    SPI_RC_ELEMENT_ERROR   0x00080000   SGML Element in Error  
    SPI_RC_ELEMENT_NAMESPACE_ERROR   0x00100000   SGML Namespace in Error (for element)  
    SPI_RC_ATTRIBUTE_ERROR   0x00200000   SGML Attribute in Error (one or more)  
    SPI_RC_ATTRIBUTE_NAMESPACE_ERROR   0x00400000   SGML Attribute in Error (one or more)  
    SPI_RC_QUOTE_ERROR   0x00800000   Error Quoting Value  
    SPI_RC_NO_CLOSE_ERROR   0x01000000   Failure to Close Tag or Stopped Parse  
    SPI_RC_TO_MANY_PARAMETERS   0x02000000   Overflow in Parameter List  
    SPI_RC_ELEMENT_CASE_ERROR   0x04000000   Element XHTML Case Mismatch  
    SPI_RC_ATTRIBUTE_CASE_ERROR   0x08000000   Attribute XHTML Case Mismatch  
  Attribute Property Errors        
    SPI_RC_VALUE_ERROR   0x10000000   HTML or CSS Value(s) in Error   
    SPI_RC_UNKNOWN_PROPERTY    0x20000000   Unknown CSS Property or Properties  
  Break Codes          
    SPI_RC_BREAK_MASK   0x0000000F   Break Type Mask  
    SPI_RC_BREAK_NORMAL   0x00000000   Broke on Space, ';' or '.'  
    SPI_RC_BREAK_ELEMENT   0x00000001   Broke on Start of Tag  
    SPI_RC_BREAK_CHAR   0x00000002   Broke on Start of Char Entity  

  

Each parameter also has error bits. Certain error conditions will result in the parser stopping while moving through a tag. For example, forgetting the P element:

< STYLE="text-align: center"> 

Will have the SPI_RC_NO_CLOSE_ERROR flag set since the ‘=’ character is interpreted as part of the element name and therefore is in error, as such the parse is stopped. On calling for the next items, the parser will return the remainder of the tag as text and spaces:

1 -- "text-align:

2 --

3 -- center"> 

Related Functions

Platform Support

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

Legato IDE, Legato Basic