Building a Data Set with a XQuery Data Source
A data set, or query, specifies the data to be retrieved from a specific data source. The data of a data set can then be used in any number of reports.
In a data set that uses a data source of type CentraSite XQuery, the data are retrieved from the CentraSite registry by a query in XQuery syntax and format. For details on XQuery in CentraSite, contact your CentraSite support organization.
To build a data set that uses a data source of type
CentraSite XQuery
1. In the BIRT Data Explorer view, select the Data Sets entry.
2. Select New Data Set from the context menu.
3. In the New Data Set wizard, specify:
A name of your choice for the data set.
The data source of type
CentraSite XQuery that is to be used to connect to the
CentraSite registry.
The data set type. You can only select
CentraSite XQuery for data sets using a
CentraSite XQuery data source.
4. Click Next.
5. On the
Specify XQuery Page, enter the query that specifies the data to be retrieved from the registry and to be included in the data set.
Example: The following query retrieves all registry objects of type Organization from the registry:
declare namespace
cs="http://namespaces.CentraSite.com/Schema/jaxr"; for $ro in
collection("CentraSite")/cs:organization return $ro
6. Click Next. The
Define Table Mapping Page is displayed, showing the schema information for the elements that match the query in the XML Structure field.
7. On the Define Table Mapping page, select the element of the XML structure that is to be mapped to a table which is usable by BIRT, click the > button and specify the XPath expression for addressing the selected element in the registry. The XPath expression is entered in the XPath expression field of the Define Table Mapping page.
Note:
To display the name or description of an element, select the corresponding localString entry in the XML structure instead of the name or description entry. The reason is that the values of these elements are available as localized strings but not in a locale-independent way.
8. Click Next.
9. On the
Define Column Mapping Page, specify the elements of the XML structure that are to be mapped to table columns which are usable by BIRT. You can specify a mapping in one of the following ways:
Click an element in the XML Structure field, then click the > button, and specify the column name, XPath expression and data type in the dialog displayed.
Click the <new mapping here> entry in the Column Mapping table, and type the column name, XPath expression and data type directly in the table.
10. Click Finish to create the data set with the specified name and data.
Related Topics