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)
Querying and Accessing (XML) Data Sets
Mr.Reed
Hi there,<br />
<br />
i am using a xml as data source. I further use a data set, to access the data. by using a table or list all of all of the data can be shown or listed.<br />
<br />
now what i would like to do:<br />
accessing only a specific element (let's say the first or last element of the data) and use an different report item than table or list to write the information in a continuous text.<br />
<br />
For example when having the xml:<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
<order>
<item1>blah</item1>
<item2/>blubb</item2>
</order>
<order>
<item1>blah2</item1>
<item2/>blubb2</item2>
</order>
</pre>
<br />
Now by using the report item "Text" or "Dynamic Text", is there a way of telling Birt to just use the first Element and write in a text, like<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>Your first order was <first order, i.e.first element of xml></pre>
??<br />
<br />
Thanks in advance!
Find more posts tagged with
Comments
Jitters
I'm working through similar issue with trying to flatten out highly normalized XML.
I've taken the approach of creating many datasets* prefiltered in the row mapping using XPath syntax like
/xml/plan/details[
@name='
;heres the criteria']/childdetail/attribute
I didn't have much luck in setting multiple xpath criteria within a single row mapping using syntax like (although valid xpath):
/xml/plan/details[
@name='
;heres the criteria']/childdetail[
@name='
;heres more criteria']/attribute
Instead, I mapped row to the lowest level element, defined only one xpath condition, then defined additional filters on the dataset itself. Still working on data transformation from this point without using XSLT or java classes.
I also was not able to define multiple XPATH paths within the row mapping in order to bring in elements from different node trees like:
/xml/plan/details[
@name='
;heres the criteria']/childdetail || /xml/plan/project[
@name='
;heres project attrib criteria']/childdetail
*I'm still looking for info on whether there will be an impact by creating large number of datasets or when this may present an issue.