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 datasource issue
vlpe
I have an xml data file. I create data source and data set objects and set the data source to a table object. Why each element in xml file is displayed n-1 times in the table and how to solve this issue? Maybe bad xpath expression? See code attached below.
dataSourceHandle.setProperty("FILELIST", "Z:/data.xml");
OdaDataSetHandle dataSetHandle = efactory.newOdaDataSet( "Data Set",
"org.eclipse.birt.report.data.oda.xml.dataSet");
dataSetHandle.setDataSource("Data Source");
StringBuilder xpath = new StringBuilder();
xpath.append("table0#-TNAME-#table0#:#[/root/row]#:#");
for (int i = 0; i < colCount; i++) {
String colName = meta.getColumnName(i + 1);
xpath.append(String.format("{%s;String;%s},", colName, colName));
}
Find more posts tagged with
Comments
vlpe
Solved. The problem was in table fill loop, it is only necessary to insert one DataItemHandle element for each column not one for each row. Thanks again.