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 Data Source Optimization
linucksrox
Hi,<br />
<br />
I'm struggling to get data in from large XML data sources having to wait sometimes 5 or 10 minutes for a report to generate because of nested tables, etc. Is there any way to script a data set to use an XML data source and programatically iterate through sub elements as needed, instead of nesting entire tables? For example, if I have a customer which may have multiple emails and addresses, the XML is currently<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
<customer>
<first_name>
<last_name>
<addresses>
<address>
<address_1>
<address_2>
<city>
...
<address>
...
</addresses>
<emails>
<email>emailaddress@gmail.com</email>
<email>another_address@gmail.com</email>
...
</emails>
</pre>
Right now I have to iterate through emails as one data set/table, addresses as another data set/table, and then have an outer table with the top level customer information, which takes quite a while to parse through about a 20 MB file.<br />
I'd like to program the fetch method of the data set to automatically iterate through each address/email as they appear. Is this possible? Do I have to script a data source as well? How do you script a data source to pull in the exact same XML data?
Find more posts tagged with
Comments
kclark
One possible optimization you could try is to flatten the patterns, it should speed things up.<br />
<br />
For example look at this XML<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
<person>
<firstname>Kris</firstname>
<lastname>Clark</lastname>
</person>
</pre>
<br />
Could be expressed as<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
<person firstname="Kris" lastname="Clark"/>
</pre>
<br />
Since it's flat the parsing is usually faster. Though I don't know how practical this would be for you since you already have a 20MB XML file. <br />
<br />
You can also try progressive rendering, <a class='bbc_url' href='
http://www.birt-exchange.org/org/devshare/deploying-birt-reports/259-birt-progressive-viewing-during-render/'>here's
the devshare</a> it'll show the first page of the report while the rest is still rendering.