Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
How to retrieve the data from a tree-hierarchy XML data source?
peonest
I want to use XML file as the data source for a report, the structure of it is like a tree, eg:
There is only a top gate within each module, and each gate can contain numbers of sub gates or events, the event is a terminal node in this tree(leaf node), which cannot contain any more sub elements, here is a piece of the XML.
<module name="Module">
<TopGate name="TG">
<ChildGate name="G1">
<ChildGate name="G2"/>
<ChildGate name="G3"/>
<ChildEvent name="E1"/>
<ChildGate/>
<ChildGate name="G5">
<ChildGate name="G6">
<ChildGate name="G7"/>
<ChildEvent name="E2"/>
<ChildGate/>
<ChildGate name="G8"/>
<ChildEvent name="E3"/>
<ChildGate/>
<TopGate/>
</module>
In the wizard page for table mapping, it seems that no matter what elements I select in the XML Structure hierarchy tree, the default XML datasource and dataset cannot retrieve all the gates/events for me.
In order to retrieve all the elements in the module, I can think of one solution. Firstly get all the contents in the XML via EMF model, and then set them into a plat text file to make all the elements parallel, then use "Flat File Data Source" and retrieve data from it instead. This way may be feasible, but still somewhat weird, as it has to create a redundant text file.
My question is that is there any other more common solutions for this type of XML hierarchy? Is ODA data source and ODA data set fit for this requirement? If I want to add a new ODA data source for this specific module, can you give me some brief guide or send me a simple sample? Appreciate for your kindly help.
Thanks!~
Find more posts tagged with
Comments
mwilliams
Hi peonest,
So, this is the exact way the xml data looks? I can't even get this to open without changing it a little. How do you want it to look in your dataSet?
peonest
Hi Michael,
Actually, you're right, this is only a fragment of the XML, not the whole, sorry for this. I just want to know in what way can I retrieve the data, I'm trying to create an ODA datasource and dataset. Do you have any suggestion?
Thanks for your concern on my problem!
Calvin