In this tutorial, we are going to discuss the XML Schema Definition (XSD). When we working with XML files as input/output we need to create an XSD or DTD to validate or format the input/output content.
Let’s Discuss on how to create an XML Schema Definition (XSD).
To start creating the XSD, drag and drop the Schema pallet to the root folder and double click on it.
Schema-Pallet
Before creating the XML Schema Definition, we need to understand the input/output XML format like the elements name, attributes etc. For this example, I am going to create an XSD for the below XML format.
<?xml version="1.0"?>
<catalog>
<book id="bk101">
<author>Gambardella, Matthew</author>
<title>XML Developer's Guide</title>
<genre>Computer</genre>
<price>44.95</price>
<publish_date>2000-10-01</publish_date>
<description>An in-depth look at creating applications
with XML.</description>
</book>
<book id="bk102">
<author>Ralls, Kim</author>
<title>Midnight Rain</title>
<genre>Fantasy</genre>
<price>5.95</price>
<publish_date>2000-12-16</publish_date>
<description>A former architect battles corporate zombies,
an evil sorceress, and her own childhood to become queen
of the world.</description>
</book>
<book id="bk103">
<author>Corets, Eva</author>
<title>Maeve Ascendant</title>
<genre>Fantasy</genre>
<price>5.95</price>
<publish_date>2000-11-17</publish_date>
<description>After the collapse of a nanotechnology
society in England, the young survivors lay the
foundation for a new society.</description>
</book>
</catalog>
Schema Elements
Schema Typed
Schema Content Model
Schema Element Attribute
Pictorial representation of XML Schema Definition (XSD)
Read ‘Tibco BW development tutorial how to configure parse XML and render XML activity step by step guide‘ to see how we can use the Schema