Difference Between Parse XML And Render XML Activity In TIBCO

By | December 7, 2013

While developing processes in TIBCO designer, Parse XML and Render XML activities are widely used. There is often a question in minds of people who are new to TIBCO development that “What is the difference between Parse XML and Render XML activity?”.

Parse XML task is used when you have an XML document stored in a string or binary field. This activity produces a tree representation of the XML that can be used by subsequent activities in the flow.

On the other hand, Render XML activity in TIBCO designer does opposite to Parse XML activity; i.e. it takes an XML tree for a specified schema and converts it to a string or binary element that contains the XML document.

Example of Using Parse XML and Render XML activity in TIBCO designer:

In our example we will use both Parse XML and Render XML activities in a process. We have a XML file stored in a text file with the contents as below:

<?xml version=”1.0″ encoding=”utf-8″?>
<Employee
xmlns:xs=”http://www.w3.org/2001/XMLSchema”
xmlns=”http://www.tibco.com/schemas/XMLTest/Schemas/Schema.xsd”
targetNamespace=”http://www.tibco.com/schemas/XMLTest/Schemas/Schema.xsd”>
<EmployeeDetails>
<Name>Ajmal</Name>
<Age>26</Age>
<DOB>08-08-1987</DOB>
</EmployeeDetails>
</Employee>

We create XML Schema (XSD) in our project Scheme folder for this XML file as shown below:

XML Schema

We create a new process ParseAndRender with both ParseXML and RenderXML activities as shown below:

parse and render xml process

 

Read File activity is used to read the XML string data from a text file Employee.xml. In the Parse XML activity configuration, we specify text as Input Style.

parse xml configuration

 

In ParseXML input tab, we map Text Content of Read File activity to its XMLString field.

parse xml input

 

In Output editor tab of Parse XML activity configuration, we select XML Schema (XSD) which we created as Employee.xsd for our example project.

parse xml output editor

 

After choosing this xml scheme in output editor, we can see that output of Parse XML activity is based on this schema as shown in its Output tab:

parse xml output

In Render XML activity configuration, select Text as output style as shown below:

render xml configuration

In Input Editor tab of Render XML activity, select Employee.xsd XML schema.

render xml input editor

In Render XML input, map output of Parse XML by using “Make a copy of” radio button. This will map Employee details to relevant XML output fields of Render XML activity.

render xml input make a copy of

Output of Render XML activity is a XML String containing XML data in text format.

render xml output

Now we are done with configuration of all process activities. Its time to test the process.

Load the process in Designer Tester and observe the output of Parse XML and Render XML activities.  As shown below, ParseXML activity output is showing output as XML structured data based on the text read from file by Read File activity.

tester parse xml output data

 

And below you can see that RenderXML activity has output as a string with that XML data in it.

tester render xml output

 

Ajmal Abbasi

Ajmal Hussain Abbasi is a TIBCO Consultant By Profession with more than 6 years experience in TIBCO products. He has extensive practical knowledge of TIBCO Business Works, TIBCO Spotfire, TIBCO BE, EMS and TIBCO ActiveSpaces. He has worked on a number of highly critical integration projects in Telecom sector by using his skills in Tibco Designer, Adapters, TIBCO EMS, RV, Administrator, TIBCO BE, TIBCO ActiveSpaces etc. Ajmal Abbasi is also experienced in developing solutions using Oracle PL/Sql, Linux and Java. You can contact Ajmal Abbasi for Consultancy, Technical Assistance and Technical Discussions.

More Posts - Website - Facebook - LinkedIn

4 thoughts on “Difference Between Parse XML And Render XML Activity In TIBCO

  1. Ahmad Syahruddin

    How can i get data in ParseXML into group of JDBC Update. I’ve succeeded load data into PArseXML, but failed when insert those data into table.

    The Structure :
    START – READFILE – PARSEXML – (JDBC UPDATE or WRITE FILE) – END . in paranthesis means GROUP OF LOOP.

    Thanks for advise

    Reply
  2. Pravin

    I am doing the same process without render xml. I am just calculating average marks for all students and i am able to receive data from xml file but while calculating average, i am not able to get all data from parse xml, its giving up the first record alone.

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *