XMLDBX Type Specification

XMLDBX Type Specification

Introduction

XMLDBX is a set of tools and an XML data specification that allow various applications to communicate via the same XML data format. It is designed to represent basic programmatic types between different applications efficiently.

Variables

A variable is a single item of data. It may be a “core” type or it may be an aggregate type comprised of multiple core types or even other aggregate types.

Names

Variable names must adhere to the XML standards for variable naming, non conforming names will be replaced with 'xag' and be given a name attribute which will conform to HTML standards.

Values

Variable values can be stored either as an attribute within an XML tag or as the explicit value between begin and end tags. A compliant XMLDBX decoder should work with either format.

Attributes

Variables can have “attributes” assigned to them. This allows extra information to be passed from the XML creation program to the XML decoding program. The following attributes can be found in the XMLDBX format.

Classname

The type attribute “Classname” indicates to the decoder the type of object to re-create, its form is “cn='CLASSNAME' “where “CLASSNAME” represents a type known to the decoder.

Extra

The type attribute “Extra” indicated to the decoder some aspect of the data represented by the tag that both the encoder and decoder agree, its form is “ex='attr'” where “attr” is known to both encoder and decoder.

IS Reference

The type attribute “Is Reference” indicates to the decoder that variable represented by the tag is a reference, its form is “I='1'.” This is used by PHP and optional.

Length

The type attribute “Length” indicated the length of the variable to the decoder, its form is “cb='len'” where “len” represents the length of the object.

Name

The type attribute “Name” indicates the name of the tag when it includes characters which are invalid for an XML name, its form is “n='name'” where “name “ represents the name of the tag.

Reference Count

The type attribute “Reference Count” indicates to the decoder the number of times the tags is referenced by other variables, its form is “C='n'” where 'n' is a number. This is used by PHP and is optional.

Reference

The type attribute “Reference” indicates that the XML tag's data will be referenced by later tags, its form is “R='XXXXXXX'” where “XXXXXX” is a hexadecimal reference number that is used by the reference type to address this tag.

Type

The type attribute indicates the type of data represented by the tag, its form is “t='TYPE'” where “TYPE” is representative of the variable type.

Value

The value attribute “v='value'” is used to compact the XML stream and save space. Its use is shown below.

Version

The version tag indicates the version of the XML format. Version is currently “1.0.”

Core Types

Core types are non-aggregate types, that is they contain only one value. A core type should also be natively represented in the various platformed, integer numbers, floating point or numeric numbers, strings, booleans, or individual characters.

Boolean

A boolean is a simple TRUE or FALSE evaluation. In C and C++ it is not defined. In SQL it is define as “boolean.” (This varies by SQL vendor.)

<varname t='b'>true</varname>

<varname t='b' v='true'/>

Double

A floating point number is a number with decimal point information, such as “3.1415.” In C and C++ this is represented using “float” or “double.” In SQL this is represented as “numeric.” (This varies by SQL vendor.)

<varname t='f'>number</varname>

<varname t='f' v='number'/>

Long

An long is an integer number with no decimal point. In C and C++ this is an “int.” In SQL this is an “integer.”

<varname t='l'>number</varname>

<varname t='l' v='number'/>

String

A string is a series of alpha-numeric characters. In C or C++ this is represented as a character pointer, “char *” In SQL, this can be represented as a “varchar.”

<varame t='sz'>string data</varname>

<varname t='sz' v='string data'/>

Aggregate Types

Aggregate types are collections of multiple data objects. An aggregate type has no individual value, on those of its component objects.

Arrays

Arrays are an aggregate of a singular component type.

<varname t='a'>

more varaibles

</varname>

Objects

Objects are aggregates of different types.

<varname t='o'>

more variables

</varname>

Reference

A reference references a previous value. The value of a reference is the same as the “reference attribute” of a previous tag.

<varname t='r' v='6B3224'/>