Document Type Description

The class describing XML-file has to follow a DTD. The DTD does not describe the syntax completely. So some additional explanation is given here:

You describe one top level class per XML-File. Objects of this top level class are exchanged between applications. To ease handling of complex classes you can define subclasses the top level class is build from.

First you have to define a namespace for the following defintions.

Then you can define constants of type boolean, integer, byte, string and floating point. You give them a name and value.

You can define enumeration values.

Then you define the subclasses. A special kind of subclass is a Union, consisting of a choice of types.

At last you define the top level class which must not be a Union. It is not possible to define a Union as member of Union itself.

The members of a class are item, array or list of another type which can be a subclass or a primitive type. Keywords: item-of, list-of, array-of. It is not possible to define a list or array of Union!

The primitive types are boolean, byte, integer, fp (floating point), string or object. A member of type object is a reference to an arbitrary object given at runtime (it has to be described in this or another XML-file), in java realised as Object, in C realised as pointer to xf_instance_t.

An array has a defined size, the size of a list is given at run-time.

<!-- root of object exchange and transfer xml file -->
<!ELEMENT xfer (namespace,version,(const|enum|subclasses)*,class)>


<!-- namespace -->
<!ELEMENT namespace (#PCDATA)>
<!ATTLIST namespace name CDATA #REQUIRED>

<!-- version -->
<!ELEMENT version (#PCDATA)>
<!ATTLIST version major CDATA #REQUIRED>
<!ATTLIST version minor CDATA #REQUIRED>

<!-- value -->
<!ELEMENT value (#PCDATA)>
<!ATTLIST value name ID #REQUIRED>

<!-- constant definition -->
<!ELEMENT const (value)>
<!ATTLIST const type (integer|long|fp|byte|string|boolean) #REQUIRED>

<!-- enumeration definition 
-->
<!ELEMENT enum (member)+>
<!ATTLIST enum type ID #REQUIRED>

<!-- enum member -->
<!ELEMENT member (#PCDATA)>
<!ATTLIST member name ID #REQUIRED>


<!-- element of type <type> and item <item>  -->
<!ELEMENT item-of EMPTY > 
<!ATTLIST item-of type CDATA #REQUIRED>
<!ATTLIST item-of name CDATA #REQUIRED>

<!-- list of type <type> and name <item>  -->
<!ELEMENT list-of EMPTY > 
<!ATTLIST list-of type CDATA #REQUIRED>
<!ATTLIST list-of name CDATA #REQUIRED>

<!-- array (fixed sized list) of type <type> and name <item>  -->
<!ELEMENT array-of EMPTY > 
<!ATTLIST array-of type CDATA #REQUIRED>
<!ATTLIST array-of size CDATA #REQUIRED>
<!ATTLIST array-of name CDATA #REQUIRED>

<!-- definition of a class -->
<!ELEMENT class (item-of|list-of|array-of)*> 
<!ATTLIST class type ID #REQUIRED>

<!-- definition of a union -->
<!ELEMENT union (item-of)*> 
<!ATTLIST union type ID #REQUIRED>

<!-- section for sub-elements -->
<!ELEMENT subclasses (class|union)*> 



Generated on 4 Mar 2014 for xfergen by  doxygen 1.4.7