[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [birt-news] XML dataset aggregation

Is there a way to do aggregation across XML elements (as described below) with BIRT without using XPath?

 


From: Chandrashekar N [mailto:Chandrashekar.N@xxxxxxxxxxxxxxxx]
Sent: Tuesday, July 31, 2007 9:04 PM
To: Alec Lebedev
Subject: RE: [birt-news] XML dataset aggregation

 

AFAIK xpath functions are not supported by Birt.

 

Regards,

Chandra


From: birt-news-bounces@xxxxxxxxxxx [mailto:birt-news-bounces@xxxxxxxxxxx] On Behalf Of Alec Lebedev
Sent: Tuesday, July 31, 2007 11:47 PM
To: birt-news@xxxxxxxxxxx
Subject: [birt-news] XML dataset aggregation

I am using BIRT 2.2 and trying to create a dataset based on an XML data source. The XML file contains the top <projects> element, which encapsulates a list of <project> elements each of which contains one <projectName> sub-element a list of <member> sub-elements. Here is a generic structure of the XML file:

<projects>

 

  <project>

    <projectName>P-1<projectName>

    <members>

       <member>Alice</member>

       <member>Bob</member>

       <member>Dave</member>

       ….

    </members>

  </project>

 

  <project>

    …

  </project>

  …

</projects>

 

 

I am using XPath expressions to define a data set with two columns. One column should list projectName values and the other column should list the count of <member> sub-elements for the corresponding project.

 

I defined Table Mapping in “Edit Data Set” dialog using “/projects/*” XPath _expression_. I also defined the “Column Mapping” for the first column as “projectName” XPath _expression_. This works fine and I see a list of project names in “Preview Results”, However, when I define the second column as “count(members/member)” the column contains empty cells.

 

Is there a way to define XML aggregate operations in BIRT and how to do it correctly?

 

Thanks.

 

Alec