Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » Failed to retrieve all XML nodes
Failed to retrieve all XML nodes [message #870850] Wed, 09 May 2012 22:42 Go to next message
Filipe Apóstolo is currently offline Filipe ApóstoloFriend
Messages: 4
Registered: May 2012
Junior Member
Hello to everybody!!

I've started to use BIRT today.
And I found it fantastic, congrats!!!

However I'm facing a problem, I'm not finding the solution (i've followed tutorials, advanced examples and explored every items of BIRT palette)

I added a data source from a XML file ->Ok

the XML file is a project file output of a software which contains a list of systems.

Each system as attributes for example 'system name', read/write variables control cycle, and each system is composed by a dynamic variables list.

Down here I've create a example XML:
<Project>
<System>
<Att1 a=a1, b=b2 ></Att1>
<Att2 a=a1, b=b2 ></Att2>
<VariablesList>
<Variable a=a1, b=b1>
<Name>VarA</Name>
<Att2>some data</Att2>
.....
</Variable>

<Variable a=a1, b=b1>
<Name>VarA</Name>
<Att2>some data</Att2>
.....
</Variable>

<Variable a=a1, b=b1>
<Name>VarA</Name>
<Att2>some data</Att2>
.....
</Variable>
</VariablesList>
</System>

<System>
<Att1 a=a1, b=b2 ></Att1>
<Att2 a=a1, b=b2 ></Att2>
<VariablesList>
<Variable a=a1, b=b1>
<Name>VarA</Name>
<Att2>some data</Att2>
.....
</Variable>

<Variable a=a1, b=b1>
<Name>VarA</Name>
<Att2>some data</Att2>
.....
</Variable>

<Variable a=a1, b=b1>
<Name>VarA</Name>
<Att2>some data</Att2>
.....
</Variable>
</VariablesList>
</System>

I'm able to retrieve and report all data from each system as explained at the tutorial.
But the data set is only returning 1 variable of each system and (all my files have in average 5 variables per system)

Creating a data set using <Variable> all variables are retrived, but now I'm not capable to group by system.

My desired output would be something like:

->SysA
VarA Att1, Att2
VarB Att1, Att2
VarC Att1, Att2
->SysB
VarD Att1, Att2
VarE Att1, Att2
VarF Att1, Att2

With the first data set my output is:
->SysA
VarA Att1, Att2
->SysB
VarD Att1, Att2
with the second:
VarA Att1, Att2
VarB Att1, Att2
VarC Att1, Att2
VarD Att1, Att2
VarE Att1, Att2
VarF Att1, Att2

What am I doing wrong?
How can I solve this?
I've Used Data Cube but the problem is the same because I need to link the variables name from both data set and the first has only one variable.

Sorry if the post is to long but is to explain well the problem,
Thanks in Advance,
FA
Re: Failed to retrieve all XML nodes [message #871054 is a reply to message #870850] Thu, 10 May 2012 16:43 Go to previous messageGo to next message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

In your xml do you have anything that lets you know you are in System A
or System B?

Jason

On 5/9/2012 6:42 PM, Filipe Apóstolo wrote:
> Hello to everybody!!
>
> I've started to use BIRT today. And I found it fantastic, congrats!!!
>
> However I'm facing a problem, I'm not finding the solution (i've
> followed tutorials, advanced examples and explored every items of BIRT
> palette)
>
> I added a data source from a XML file ->Ok
>
> the XML file is a project file output of a software which contains a
> list of systems.
> Each system as attributes for example 'system name', read/write
> variables control cycle, and each system is composed by a dynamic
> variables list.
>
> Down here I've create a example XML:
> <Project>
> <System>
> <Att1 a=a1, b=b2 ></Att1>
> <Att2 a=a1, b=b2 ></Att2>
> <VariablesList>
> <Variable a=a1, b=b1>
> <Name>VarA</Name>
> <Att2>some data</Att2>
> .....
> </Variable>
>
> <Variable a=a1, b=b1>
> <Name>VarA</Name>
> <Att2>some data</Att2>
> .....
> </Variable>
>
> <Variable a=a1, b=b1>
> <Name>VarA</Name>
> <Att2>some data</Att2>
> .....
> </Variable>
> </VariablesList>
> </System>
>
> <System>
> <Att1 a=a1, b=b2 ></Att1>
> <Att2 a=a1, b=b2 ></Att2>
> <VariablesList>
> <Variable a=a1, b=b1>
> <Name>VarA</Name>
> <Att2>some data</Att2>
> .....
> </Variable>
>
> <Variable a=a1, b=b1>
> <Name>VarA</Name>
> <Att2>some data</Att2>
> .....
> </Variable>
>
> <Variable a=a1, b=b1>
> <Name>VarA</Name>
> <Att2>some data</Att2>
> .....
> </Variable>
> </VariablesList>
> </System>
>
> I'm able to retrieve and report all data from each system as explained
> at the tutorial.
> But the data set is only returning 1 variable of each system and (all my
> files have in average 5 variables per system)
>
> Creating a data set using <Variable> all variables are retrived, but now
> I'm not capable to group by system.
>
> My desired output would be something like:
>
> ->SysA
> VarA Att1, Att2
> VarB Att1, Att2
> VarC Att1, Att2
> ->SysB
> VarD Att1, Att2
> VarE Att1, Att2
> VarF Att1, Att2
>
> With the first data set my output is:
> ->SysA VarA Att1, Att2
> ->SysB
> VarD Att1, Att2
> with the second:
> VarA Att1, Att2
> VarB Att1, Att2
> VarC Att1, Att2
> VarD Att1, Att2
> VarE Att1, Att2
> VarF Att1, Att2
>
> What am I doing wrong?
> How can I solve this?
> I've Used Data Cube but the problem is the same because I need to link
> the variables name from both data set and the first has only one variable.
>
> Sorry if the post is to long but is to explain well the problem,
> Thanks in Advance,
> FA
Re: Failed to retrieve all XML nodes [message #871195 is a reply to message #871054] Fri, 11 May 2012 11:41 Go to previous messageGo to next message
Filipe Apóstolo is currently offline Filipe ApóstoloFriend
Messages: 4
Registered: May 2012
Junior Member
Hello,
No, there isn't however I found out the solution. I will post it as an answer.
Thanks
Re: Failed to retrieve all XML nodes [message #871197 is a reply to message #871195] Fri, 11 May 2012 11:47 Go to previous message
Filipe Apóstolo is currently offline Filipe ApóstoloFriend
Messages: 4
Registered: May 2012
Junior Member
Well, I found out how to solve the problem.
I have build a data set for each internal list:
in the above example I could create SystemDataSet, and VariablesDataSet. For each data set I select the xml path to point for the correspondent node.

And now the trick was at the collum binding, I added allways the parent node name for each sublist.

For exmaple I added the system name to the variables data set.
Then I can group and/or filter the variables by System name.
Previous Topic:Dynamic axis markers
Next Topic:Annotation/Comments addition on chart
Goto Forum:
  


Current Time: Mon Dec 22 02:48:50 GMT 2014

Powered by FUDForum. Page generated in 0.01965 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software