Home Analytics DevShare
The community of Analytics developers are invited to follow and participate in the developer network.
OpenText technical experts collaborate with supported customers and partners in the Magellan product area.

Parse XML from Database Field in BIRT Report

VirgilVirgil AdministratorEM admin
edited June 26, 2013 in DevShare
This example selects a String of XML from a database field, and then parses that string into several fields for the report. The code in this example is found in the computed columns of the Data Set as well as an expression of a data element and looks like the code below.<br />
<br />
Javascript code to parse the XML:

var parser = new DOMParser();
parser.parse(new InputSource(new StringReader(dataSetRow&#91;"student_property"])));
var nodelist = parser.getDocument().getElementsByTagName('firstname');
var entry = nodelist.item(0).getFirstChild().getNodeValue();

<br />
This example was created with BIRT 2.2

Virgil Dodson
OpenText Analytics Developer Community

Sign In or Register to comment.