XML Streams
XML streams are data streams using an XML format.They enable loosely coupled connections between components, and provide a standardized format for data transport between components. Uniface can transfer field data and data relationships via XML stream parameters. It can also attach processing information to data in an XML stream to allow the data state to be transported with the data.
Uniface-Compliant XML Streams
If you choose to handle XML streams declaratively, the structure of the XML stream is determined by Uniface using DTDs that are generated from application model entities or components and Uniface field-to-XML element mappings.
Uniface entities and fields are represented as XML elements and modification and validation status as XML attributes. Fields are represented as child elements of the entity’s element. Inner entities are represented as child elements of the outer entity. The structure of the XML stream (including the names, nesting, and order of all elements) is declared by a DTD, which is defined in the application model. Uniface uses attributes in XML streams to store data processing information and to define custom attributes.
XML streams do not make a distinction between database and non-database fields, nor between fields and entities defined in a component or in an application model. Data is saved into and loaded from XML streams in the same way, regardless of whether the entity or field occurs in your application model. Only fields database or non-database are allowed in XML streams. The value of a static field or control field cannot be included in an XML stream when using xmlsave or xmlload.
The data stream is processed to comply with the XML 1.0 standard.
Uniface converts data in fields to XML element values. This can require some conversion of data types, and substitution of characters reserved for XML syntax. These tasks are handled by the ProcScript xmlload, xmlsave, and reconnect (or retrieve/reconnect) statements.
Use the ProcScript functions $occcrc, $occstatus, $occproperties and $fieldproperties to access processing information loaded from an XML stream. The reconnect process requires occurrence modification information in order to reconnect data to a database. For more information, see Occurrence Metadata for Reconnect .
User-Defined XML Streams
If you handle XML procedurally, you have much more flexibility in the structure of the XML data and what you do with it. There are no limitations on the structure of the XML.