Parse XML from Database Field in BIRT Report
Options
Virgil Dodson
E admin
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:
This example was created with BIRT 2.2
<br />
Javascript code to parse the XML:
importPackage(Packages.org.apache.xerces.parsers); importPackage(Packages.org.xml.sax); importPackage(Packages.java.io); var parser = new DOMParser(); parser.parse(new InputSource(new StringReader(dataSetRow["student_property"]))); var nodelist = parser.getDocument().getElementsByTagName('firstname'); var entry = nodelist.item(0).getFirstChild().getNodeValue(); entry;<br />
This example was created with BIRT 2.2
Warning
No formatter is installed for the format ipb
0
Categories
- All Categories
- 108 Developer Announcements
- 53 Articles
- 106 General Questions
- 145 IM Services
- 43 OpenText Hackathon
- 32 Developer Tools
- 20.6K Analytics
- 4.1K AppWorks
- 8.9K Extended ECM
- 900 Cloud Fax and Notifications
- 77 Digital Asset Management
- 9.3K Documentum
- 29 eDOCS
- 120 Exstream
- 39.8K TeamSite
- 1.7K Web Experience Management