[urgent]XmlDataSource Problem

0
hiii,
i need to generate a report using xml datasource ,the xml file is as the following
<Merchant id="23">
<Corporations>

<Corporation>
<corp_name>corp1</corp_name>
</Corporation>
<Corporation>
<corp_name>corp2</corp_name>
</Corporation>
</Corporations>

<Owners>
<owner>
<owner_name>O1</owner_name>
</owner>
<owner>
<owner_name>O2</owner_name>
</owner>
</Owners>

<Merchant>


when i display the data only one record"the first one" is retrieved what shall i do to retieve all records?
AMM's picture
AMM
21
Joined: Sep 27 2006 - 11:55pm
Last seen: 12 years 8 months ago

3 Answers:

0
With XMLDatasources you must define "what is a record" using the XPath (the query string). In your case you could put:

/Merchant/Corporations/Corporation

if you define each Corporation node as your record. But you can also put

/Merchant/Owners/owner

and these way have a "record" for each owner.

HTH
EuzkoArima's picture
Joined: Jan 3 2007 - 6:09am
Last seen: 12 years 5 months ago
0
Can you please explain this further.

I have created a report which has one field "Name" whose Description is also "Name".

I have created an XMLData source with the following properties

Name - XMLDataSource
Type of Conn - XML file data source
XMLFile - C:\Sample.xml
Create a data source using the expresssion - /Data

My xml file looks like this
<Data>
<Name>ABC</Name>
<Name>XYZ</Name>
</Data>

When I compile and test, all that I get is ABC printed. How do I specify to the system that it needs to iterate over all the "Name"s.

Thanks in advance.
sriramns's picture
Joined: Jan 23 2007 - 4:27pm
Last seen: 12 years 4 months ago
0
Using the expresssion
/Data/Name

instead of just
/Data


And you must change the field description to
.


Regards
Post edited by: EuzkoArima, at: 2007/01/25 12:36
EuzkoArima's picture
Joined: Jan 3 2007 - 6:09am
Last seen: 12 years 5 months ago
Feedback
randomness