Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.5d

Application v 5.25a

  

 

Chapter ElevenSGML Functions (continued)

11.18 Low Level XDX Functions

11.18.1 Overview

This section describes low level access to XDX engrams. See XDX HTML Specification for additional information on XDX document and engram structure. The following is an overview of of XDX engrams as found in the specification.

This section covers a series of Legato API functions that provide support to read and write engrams.

11.18.2 Engrams

XDX data is stored within HTML in the form of “engrams”. Engrams allow information to be embedded within an HTML human readable document to identify or connect parcels of information to the XBRL data. Since HTML can be used to represent facts with an XBRL dataset, engrams can be used to cross identify numeric facts embedded within HTML and also represented as discrete facts within the XBRL instance.

Engrams can range from simple information such as “this identifies a level 1 fact” to complex information such as “the data in this row is connected to XBRL element xyz, is indented at this level and has a negated role”.

Engram characteristics: 

An engram Identifies a Group of Textual Data — It will start or stop the group of data belonging to a particular fact or element. In many cases the scope of the data is defined by the type of XDX code.

An engram can Contain One or More Parameters — Depending on the XDX Code, an engram could have more than one parameter and may contain more than one code.

An engram is Self Checking — Engrams can contain an optional check code to verify integrity.

An engram is Unique — Engrams must be unique to both be able to identify a specific piece of information and not violate any name space rules.

Engrams can be Loosely Nested — Engrams can contain other engrams and may continue to apply to a region of text until revoked or replaced by a new engram of the same level.

11.18.3 XDX Engram Format

Engrams are principally stored in the HTML ID attribute as well as the SUMMARY. They can also be stored within the NAME attribute of the A element (anchor). The ID attribute has the added advantage of being available on nearly all HTML elements as specified by HTML 4.0 (RFC xxxx). The <A NAME> combination is a convenient way to transport document information to non-HTML platforms such as Microsoft Word in the form of “bookmarks”. 

Engram Format

xdx_ffc[_param]

Where:

xdxDesignates ID as an XDX engram.
ffDefines the engram type
cIs a check code to verify the integrity of the overall engram.
paramIs any associated data. Engrams can have up to twenty (20) parameters.

 

11.18.4 HTML Embed

XDX engrams are embedded in the HTML code at two basic levels. The first is via the ID attribute and the second is using HTML comments inside of a “field” code.

Example of an engram in an HTML ID:

<TR ID="xdx_40C_ProfitLoss_01_pn6n6" STYLE="vertical-align: bottom">

Fields define a method of structuring HTML comments in a manner similar to W3C CSS data. Information is in the form “property: value; property; value”. The ‘set’ field is employed in these example since the field structure can be used by a number systems exploiting comments to carry data:

<!-- Field: Set; Name: xdx; ID: xdx_05__EntityCentralIndexKey_0000990681 -->

Engram structure is exactly the same and in fact is specified by the ID property rather than the HTML ID attribute.

11.18.5 Functions

Creating Engram Components

XDXCreateContextComponent — Creates a property formatted context string for an engram.

XDXCreateDisplayComponent — Assembles flags or array parameters to create display components for an engram.

XDXCreateElementComponent — Formats an element or concept name for placement as a component value.

XDXCreateGroupingComponent — Creates a grouping component to be placed in an engram,

XDXCreatePrecisionComponent — Creates a component string for precision and power terms.

XDXCreatePresentationComponent — Creates a property string containing presentation line item terms.

XDXCreateUnitComponent — Creates a component string for unit ID information.

XDXPropertiesToEngram — Creates an engram based on the specified properties.

Reading Engram Components

XDXGetCalculationProperties — Extracts calculation data from a component or engram.

XDXGetContextProperties — Extracts context properties from an engram or component.

XDXGetDisplayProperties — Extracts the display properties from an engram or component.

XDXGetDisplayFlags — Extracts the display flags from an engram or component.

XDXGetElement — Extracts an element from an engram or component.

XDXGetGroupingProperties — Extracts grouping properties from engram or component.

XDXGetPrecisionProperties — Extracts precision properties from engram or component.

XDXGetPresentationProperties — Extracts presentation formation for one or more facts from engram or component.

XDXGetUnitProperties — Extracts the unit properties for a fact.

XDXEngramToParameters — Parses an engram and breaks it in to its constituent parameters.

Support Functions

XDXGetContextMember — Extracts a single member pair from a context array.

XDX Engram Map

XDXEngramToProperties — Parses an engram and returns the high-level associated XBRL properties.

XDXGetEngram — Gets an engram at a specific position.

XDXGetEngramCount — Returns the current count in the engram map.

XDXGetEngramPosition — Returns the file position of a mapped engram.

XDXMapArea — Maps an area of an existing item for XDX information.

XDXMapFile — Maps an existing item for XDX information.