Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
xml as a record not data source
lpurba
Hi all,
I was wondering if I can parse or do something to my data if the data is an xml.
Let say I have a table student with student_id, student_property fields.
The student_id id is a regular record, let say, 123, and student_property is an xml record, let say
<?xml version="1.0" encoding="UTF-8"?>
<name>
<firstname>John</firstname>
<lastname>Doe</lastname>
<dob>10/01/1919</dob>
</name>
Is there any way that I can display student_property not as an xml in my table? I know I can have xml as a data source, but I don't think this one can be considered as xml data source.
Regards,
-Laurent
Find more posts tagged with
Comments
Virgil Dodson
What makes you believe that this cannot be considered XML data source? If this is an XML source available through a file path or URL then the XML Data Source would work fine. I assume <name> is your repeating element in this simple example so you would select that as the 'table' mapping, and then select firstname, lastname, and dob as the 'column' mapping. For that point on, you work with the data set fields just like you would any other data source.
In 2.2, this XML could also come from a web service.
lpurba
Hi, thanks for your reply.
What if the xml source is not available thru file path or url? Since this xml is a record on the table, how can I make this available as data source.
Regards,
-Laurent
hewb
Have you tried to use data set computed column? You should be able to extract the student info from the xml using some javaScript code.
lpurba
Hi hewb,
Thanks for your reply.
Do you have any docs or link that I can look into?
-Laurent
Virgil Dodson
Hi Laurent,<br />
<br />
I created an example using the JavaScript similar to below and uploaded it to:<br />
<a class='bbc_url' href='
http://www.birt-exchange.com/modules/wfdownloads/singlefile.php?cid=2&lid=197'>http://www.birt-exchange.com/modules/wfdownloads/singlefile.php?cid=2&lid=197</a><br
/>
<br />
Virgil<br />
<br />
Javascript code to parse the XML: <br />
<br />
importPackage(Packages.org.apache.xerces.parsers);<br />
importPackage(Packages.org.xml.sax);<br />
importPackage(Packages.java.io);<br />
<br />
var parser = new DOMParser();<br />
parser.parse(new InputSource(new StringReader(dataSetRow["student_property"])));<br />
var nodelist = parser.getDocument().getElementsByTagName('firstname');<br />
var entry = nodelist.item(0).getFirstChild().getNodeValue();<br />
<br />
entry;
lpurba
Hi Virgil,
Thanks for the script. I am going to work on it.
Regards,
-Laurent
Pallavi Akhouri
<p>Hi ,</p>
<p> </p>
<p>I am working with open Text team .We are using I-hub to generate the report . Let suppose we have One report XYZ and we want to run this report in i potal after running report for particular scenerio we are getting more than 350 pages.</p>
<p><span><span style="font-size:12pt;background-color:#FFFFFF;">while extracting these report in excel there is limitation/error in I-hub server that we can extract only 200 pages so, download excel is not giving the exact transaction</span></span>. So can anyone give the idea how we will exract actual report in .xls or it is I -hub limitation???</p>
pricher
<p>Hi Pallavi,</p>
<p> </p>
<p>You can increase the page limit by increasing the value of the ALLOW_EXPORT_PAGE_LIMIT parameter in the iHub web.xml file. Depending on your version of iHub, this file is located in either </p>
<p> </p>
<p><span style="font-family:'courier new', courier, monospace;"><iHub Install>\modules\BIRTiHub\iHub\web\birtservice\WEB-INF</span> (for iHub 16)</p>
<p> </p>
<p>or </p>
<p> </p>
<p><span style="font-family:'courier new', courier, monospace;"><iHub Install>\modules\BIRTiHub\iHub\web\iportal\WEB-INF</span> (for iHub 3.x)</p>
<p> </p>
<p>After saving the file, you need to re-start iHub.</p>
<p> </p>
<p>Hope this helps,</p>
<p> </p>
<p>P.</p>
<p> </p>
<p>PS: Next time, please post using a new topic. </p>