Newbie: Using an XML data source [message #258516] |
Tue, 16 October 2007 13:49  |
Eclipse User |
|
|
|
Originally posted by: probertm.gmail.com
Hi ..
New to BIRT and liking it a lot! Thank you.
I want to use an XML data source, which is fine and easy. Then I want to
define the dataset, which I can sort of do.
The XML is a dataset extract from an Oracle DB and then modified. It
looks something like:
<?xml version="1.0"?>
<Library>
<Documents>
<ROW num="1">
<TEXT>Alice In Wonderland</TEXT>
</ROW>
<ROW num="2">
<TEXT>Through the Looking Glass</TEXT>
</ROW>
<ROW num="3">
<TEXT>Wind in the Willows</TEXT>
</ROW>
<ROW num="4">
<TEXT>House at Pooh Corner</TEXT>
</ROW>
</Documents>
</Library>
My problem is that I don't know how to get the reporter to iterate over
the num part of the XPath. I define
Root = /Library/Documents
Item = /ROW@num
Book = /ROW/TEXT
And it returns just the first item.
Any help appreciated.
Regards,
mark
|
|
|
|
Re: Newbie: Using an XML data source [message #258741 is a reply to message #258516] |
Thu, 18 October 2007 14:08  |
Eclipse User |
|
|
|
Originally posted by: vdodson.kc.rr.com
Hi Mark,
Make sure the element you define in the Table Mapping is the repeating
element. In this case, Document only repeats once so only returns one
iteration of the data. Use /Library/Documents/Row for the table
mapping, then /@num and /TEXT for the column mappings and you will get
all 4 rows.
Virgil Dodson
http://www.birt-exchange.com
Mark Probert wrote:
>
> Hi ..
>
> New to BIRT and liking it a lot! Thank you.
>
> I want to use an XML data source, which is fine and easy. Then I want
> to define the dataset, which I can sort of do.
>
> The XML is a dataset extract from an Oracle DB and then modified. It
> looks something like:
>
> <?xml version="1.0"?>
> <Library>
> <Documents>
> <ROW num="1">
> <TEXT>Alice In Wonderland</TEXT>
> </ROW>
> <ROW num="2">
> <TEXT>Through the Looking Glass</TEXT>
> </ROW>
> <ROW num="3">
> <TEXT>Wind in the Willows</TEXT>
> </ROW>
> <ROW num="4">
> <TEXT>House at Pooh Corner</TEXT>
> </ROW>
> </Documents>
> </Library>
>
> My problem is that I don't know how to get the reporter to iterate over
> the num part of the XPath. I define
>
> Root = /Library/Documents
> Item = /ROW@num
> Book = /ROW/TEXT
>
> And it returns just the first item.
> Any help appreciated.
>
> Regards,
> mark
>
|
|
|
Powered by
FUDForum. Page generated in 0.03653 seconds