Show TOC

Procedure documentationModeling Binary Data (CCTS/Freely-Modeled) Locate this document in the navigation structure

 

Data modeling using XML schema is text-based. Binary data in an XML schema definition can therefore only be coded with a limited number of characters. XML schema provides the built-in data type xsd:base64Binary for this. This XSD type works with 65 different characters and some white space characters for the text-based coding of binary data (more information see the interne site at the address http://www.w3.org/TR/xmlschema-2/#base64Binary). In the XML data structure, the binary data can be included in this coding as content of xsd:base64Binary type elements.

The data of a binary data format in the application coding must be converted at runtime into the xsd:base64Binary format before it can be assigned to a xsd:base64Binary type element. In this way you can, for example, model binary data for a Web service communication as part of the later message payload.

Caution Caution

If the binary data modeled in a data type become very large (for example with pictures or audio files), then this can have a negative affect on the performance of applications that later access the data structure.

End of the caution.

Procedure

Modeling Binary Data in Core Data Types

There are some core date type whose primary components reference xsd:base64Binary:

  • BinaryObject

  • Graphic

  • Picture

  • Sound

  • Video

In this way you can classify the binary data type more precisely.

More information: Developing Core Data Types

Modeling Binary Data in Freely-Modeled Data Types
  1. Create a simple xsd:base64Binary type data type.

    More information: Defining a Simple Data Type (Freely-Modeled)

  2. Reference elements of a complex data type to the data type from the last step.

    More information: Defining a Complex Data Type (Freely-Modeled)