Creating Types From XSD
  • 12 May 2022
  • 1 Minute to read
  • Dark
    Light

Creating Types From XSD

  • Dark
    Light

Article Summary

Overview

XSD (XML Schema Definition), specifies how to formally describe the elements in an Extensible Markup Language (XML) document. This description can be used to verify that each item of content in a document adheres to the description of the element in which the content is to be placed.

Prerequisites

XSD file. A sample code snippet is below:

<?xml version="1.0" encoding ="utf-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">

<xs:element name="Employee">
	<xs:complexType>
		<xs:sequence>
			<xs:element name="FirstName" type="xs:string"/>
			<xs:element name="LastName" type="xs:string"/>
			<xs:element name="Position" type="xs:string"/>
		</xs:sequence>
	</xs:complexType>
</xs:element>

</xs:schema>

Example

  1. In a Designer Project, click CREATE DATATYPE/INTEGRATION. Click XML/JSON/CSV and select Create Types from XSD.  
  2. In the Create Types from XSD window, enter the XSD Structure Name,  dialog provide the Schema with a name and either use the XSD File or Paste Schema Code. In this example paste XSD Schema. When finished, select 'CREATE'.



Default Generated Steps

When an XSD type is created, there will be two default steps made available by default in the Flow Designer. These steps are called the XSD Deserialize and XSD Serialize steps and are located in the Toolbox under DATA > XSD. A common use case for these steps is in the context of web service calls. If the payload of the call contains a serialized string of the XSD datatype, the XSD Deserialize step can be used to convert that string to an accessible format. When the string is deserialized, data fields of the type can be accessible in the Flow Designer. 


For further information on Data Structures, visit the Decisions Forum.

Was this article helpful?