Skip to main content

Default XSD Types for InterSystems IRIS Data Type Classes

Default XSD Types for InterSystems IRIS Data Type Classes

If a class or a class property is based on one of the common InterSystems IRIS data type classes, the XML type is set automatically, according to the following table. Classes in the %xsd package map directly to the XML types, as shown in the table.

XML Types for InterSystems IRIS Data Types in the %Library and %xsd Packages
InterSystems IRIS Class in the %xsd Package InterSystems IRIS Class in the %Library Package XSD Type Used in Projections to XML
%xsd.anyURIOpens in a new tab   anyURI
%xsd.base64BinaryOpens in a new tab

%BinaryOpens in a new tab

%StatusOpens in a new tab

base64Binary
%xsd.booleanOpens in a new tab %BooleanOpens in a new tab boolean
%xsd.byteOpens in a new tab %TinyIntOpens in a new tab byte
%xsd.dateOpens in a new tab %DateOpens in a new tab date
%xsd.dateTimeOpens in a new tab

%PosixTimeOpens in a new tab

%StringTimeStampOpens in a new tab

%TimeStampOpens in a new tab

dateTime
%xsd.decimalOpens in a new tab

%CurrencyOpens in a new tab

%DecimalOpens in a new tab

%NumericOpens in a new tab

decimal
%xsd.doubleOpens in a new tab

%DoubleOpens in a new tab

double
%xsd.floatOpens in a new tab   float
%xsd.hexBinaryOpens in a new tab   hexBinary
%xsd.intOpens in a new tab   int
%xsd.integerOpens in a new tab   integer
%xsd.longOpens in a new tab

%BigIntOpens in a new tab

%IntegerOpens in a new tab

long
%xsd.negativeIntegerOpens in a new tab   negativeInteger
%xsd.nonNegativeIntegerOpens in a new tab   nonNegativeInteger
%xsd.nonPositiveIntegerOpens in a new tab   nonPositiveInteger
%xsd.positiveIntegerOpens in a new tab   positiveInteger
%xsd.shortOpens in a new tab %SmallIntOpens in a new tab short
%xsd.stringOpens in a new tab

%NameOpens in a new tab

%StringOpens in a new tab

%ListOpens in a new tab

string
%xsd.timeOpens in a new tab %TimeOpens in a new tab time
%xsd.unsignedByteOpens in a new tab   unsignedByte
%xsd.unsignedIntOpens in a new tab   unsignedInt
%xsd.unsignedLongOpens in a new tab   unsignedLong
%xsd.unsignedShortOpens in a new tab   unsignedShort

For information on the XML data types, see https://www.w3.org/TR/xmlschema-2/Opens in a new tab.

For example, consider the following class:

Class Schema.DataTypesDemo Extends (%RegisteredObject, %XML.Adaptor)
{

Parameter XMLTYPENAMESPACE="mytypes";

Property binaryprop As %xsd.base64Binary;

Property booleanprop As %Boolean;

Property dateprop As %Date;

Property datetimeprop As %TimeStamp;

Property decimalprop As %Numeric;

Property integerprop As %Integer;

Property stringprop As %String;

Property timeprop As %Time;

}

The schema for this class is as follows:

<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:s="http://www.w3.org/2001/XMLSchema" 
elementFormDefault="qualified" targetNamespace="mytypes">
  <complexType name="DataTypesDemo">
    <sequence>
      <element minOccurs="0" name="binaryprop" type="s:base64Binary"/>
      <element minOccurs="0" name="booleanprop" type="s:boolean"/>
      <element minOccurs="0" name="dateprop" type="s:date"/>
      <element minOccurs="0" name="datetimeprop" type="s:dateTime"/>
      <element minOccurs="0" name="decimalprop" type="s:decimal"/>
      <element minOccurs="0" name="integerprop" type="s:long"/>
      <element minOccurs="0" name="stringprop" type="s:string"/>
      <element minOccurs="0" name="timeprop" type="s:time"/>
    </sequence>
  </complexType>
</schema>
FeedbackOpens in a new tab