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:
Recommended: How to Create XSD in TIBCO BW
We create a new process ParseAndRender with both ParseXML and RenderXML activities as shown below:
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.
In ParseXML input tab, we map Text Content of Read File activity to its XMLString field.
In Output editor tab of Parse XML activity configuration, we select XML Schema (XSD) which we created as Employee.xsd for our example project.
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:
In Render XML activity configuration, select Text as output style as shown below:
In Input Editor tab of Render XML activity, select Employee.xsd XML schema.
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.
Output of Render XML activity is a XML String containing XML data in text format.
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.
And below you can see that RenderXML activity has output as a string with that XML data in it.
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
Solved, i use repeat-until-true with condition : count(root-of-xml-data)<$i.
Thank's 😉
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.
good
Hi sir ,
Can we pass xml data to parse xml directly with out using read actvity? . if there is possible, could you please give a suggestion ” how is it”
Thanks,
Suresh
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.
i’m getting an error.
TIBCO-BW-PALETTE-ADBPLUGIN-300001. DataEventPoller Schema {0} starts polling message
plz guide me here to solve this .
Thanks
smit
Hi Ajmal,
I am new to Tibco, I have an XML file which have element having name attribute eg,
6
How can I get value ‘6’ from this file.
Please help.
Thanks in advance.
I’m having an error while parsing this exact file, it says xml data is not well formed.