One question often rises in minds of the people working in TIBCO BW that how to create a XML Document based on a schema inside TIBCO designer projects? Creation of XML document from an XSD (Schema) is easy in TIBCO Designer using XML Instance activity which is available in the XML Palette of designer.
In this tutorial, you will learn how you can create XML using Instance activity in TIBCO designer based on a Schema definition.
Step 1: Create XML Schema (XSD) in TIBCO Designer:
We are going to create an XML Instance based on a Schema definition. Create a new XML Schema by choosing Schema from XML Tools Palette. The schema created is shown in the screenshot below:
Step 2: Create XML using Instance activity in TIBCO Designer
Go to XML Tools Palette and add a new Instance activity in the project. Double click on the Instance. XML Instance window will have only root element in it now as shown in the screenshot below:
Now we need to use the Schema that we created in Step 1. On the top of the window, we have Set Schema option available. Click on this and a new Pop up window will open asking you to choose the schema to be used:
Once Schema is chosen, Its elements get populated in the XML Instance window along with the namespaces as you can see in the screenshot below:
Just specify the values for the elements (name and age in this case) and click on the apply button:
Go to the source tab and you can see the final XML sample created based on the specified XSD: