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
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>