Create Types From XSD
- Updated on 25 May 2015
- 2 minutes to read
XSD (XML Schema Definition), a Recommendation of the World Wide Web Consortium (W3C), 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.
In this example we will create Type From XSD and use this Schema to deserialize XML object and display it on the Form .
We begin in the Designer Folder with selecting Datatypes/Database > XML/JSON > Create Types from XSD from Folder Actions Panel.
In the resulting pop-up window we provide our Schema with a Name and either use XSD File or Paste Schema Code . In this example we paste XSD Schema . When finished, click Ok .
System creates XSD Data Structure.
Next, we can start creating our Flow where we will use XSD Schema Type . From Folder Actions Panel click Create Flow button.
Then, we Name our Flow and click Create to proceed to the Flow Designer.
In the Flow Designer we addDeserialize note step from All Steps [Catalog]> User Defined Types > XSD Structures > NoteXMLSchema category.
Next, we select Deserialize note step on the workspace and Step Information Layer pops up. We can configure this step within this Layer . We define Constant Mapping Type for String To Deserialize Input and paste the String that represents anXML object into Value text box. This XML object fit in description that we defined in our XSD Schema Type (the input for this step may be a result of Webservice call).
Then, add Show Form step from the Favorite Steps category on the Done outcome from Deserialize note step.
In the resulting window we Name our Form and click Create to proceed to the Form Designer.
In the Form Designer we use Data Grid component from the List category in the ToolBox to display deserialized result from XML object . For this component we pick note type that we defined at the beginning of this tutorial. At the end our Form Design looks as following... When finished, we can save the Form and close Form Designer.
Next, we connect steps in our Flow as following… Then, we select Form step on the workspace and Step Information Layer pops up. We select Show Mapping Editor option.
In the Mapping Editor we select Build Array Mapping Type for the Data Grid component. Then, we connect Output from Deserialize step to the Item 0 in the Array for Data Grid . Click Ok to save and close Mapping Editor.
This completes our Flow . We can click Debug Flow link on the top panel of the Flow Designer to test our Flow .
Note that in Decisions version 3.5 and above, you'll need to click Test Flow to access the Debugger .
Our Form opens in the Debugger . Data Grid component displays deserialized XML object . Click Done to terminate Flow execution.
Diagram in the Debugger shows that the Flow ran to the End step with no issues.