Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Extract values from multiple elements (XML data source)
Extract values from multiple elements (XML data source) [message #368104] Mon, 04 May 2009 21:39 Go to next message
Eclipse UserFriend
Originally posted by: asd.asd.com

I have this XML:

<root id="root" >
<head>
<section secid="section">
<subsection>
<item order="0">
<data id="D1" value="red"/>
<data id="D2" value="blue"/>
</item>
<item order="1">
<data id="D1" value="green"/>
<data id="D2" value="yellow"/>
</item>
<item order="2">
<data id="D1" value="black"/>
<data id="D2" value="white"/>
</item>
</subsection>
</section>
</head>
</root>

Now I would like to extract all values where id=D1, which should result in:

red
green
black

I have defined the rowmapping:

/root

and this column mapping:

/head/section/subsection/item/data[@id="D1"]/@value

But the result is only:

red

instead of:

red
green
black

Any ideas on how to get values from the remaining item/data elements
(without changing the rowmapping!)?
Re: Extract values from multiple elements (XML data source) [message #368105 is a reply to message #368104] Tue, 05 May 2009 06:07 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: night.roger.gmail.com

Row xpath: /root/head/section/subsection/item/data[@id="D1"]
Column xpath: /@value

--
Thanks,
Wenjie

"JS" <asd@asd.com> wrote in message news:gtnnb6$e8s$1@build.eclipse.org...
>I have this XML:
>
> <root id="root" >
> <head>
> <section secid="section">
> <subsection>
> <item order="0">
> <data id="D1" value="red"/>
> <data id="D2" value="blue"/>
> </item>
> <item order="1">
> <data id="D1" value="green"/>
> <data id="D2" value="yellow"/>
> </item>
> <item order="2">
> <data id="D1" value="black"/>
> <data id="D2" value="white"/>
> </item>
> </subsection>
> </section>
> </head>
> </root>
>
> Now I would like to extract all values where id=D1, which should result
> in:
>
> red
> green
> black
>
> I have defined the rowmapping:
>
> /root
>
> and this column mapping:
>
> /head/section/subsection/item/data[@id="D1"]/@value
>
> But the result is only:
>
> red
>
> instead of:
>
> red
> green
> black
>
> Any ideas on how to get values from the remaining item/data elements
> (without changing the rowmapping!)?
Re: Extract values from multiple elements (XML data source) [message #368108 is a reply to message #368105] Tue, 05 May 2009 07:48 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: asd.asd.com

Ok but the point was that the rowmapping was not allowed to change from eg:

/root
or
//root



"Wenjie Tu" <night.roger@gmail.com> wrote in message
news:gtol3c$ivn$1@build.eclipse.org...
> Row xpath: /root/head/section/subsection/item/data[@id="D1"]
> Column xpath: /@value
>
> --
> Thanks,
> Wenjie
>
> "JS" <asd@asd.com> wrote in message news:gtnnb6$e8s$1@build.eclipse.org...
>>I have this XML:
>>
>> <root id="root" >
>> <head>
>> <section secid="section">
>> <subsection>
>> <item order="0">
>> <data id="D1" value="red"/>
>> <data id="D2" value="blue"/>
>> </item>
>> <item order="1">
>> <data id="D1" value="green"/>
>> <data id="D2" value="yellow"/>
>> </item>
>> <item order="2">
>> <data id="D1" value="black"/>
>> <data id="D2" value="white"/>
>> </item>
>> </subsection>
>> </section>
>> </head>
>> </root>
>>
>> Now I would like to extract all values where id=D1, which should result
>> in:
>>
>> red
>> green
>> black
>>
>> I have defined the rowmapping:
>>
>> /root
>>
>> and this column mapping:
>>
>> /head/section/subsection/item/data[@id="D1"]/@value
>>
>> But the result is only:
>>
>> red
>>
>> instead of:
>>
>> red
>> green
>> black
>>
>> Any ideas on how to get values from the remaining item/data elements
>> (without changing the rowmapping!)?
>
>
Re: Extract values from multiple elements (XML data source) [message #368111 is a reply to message #368108] Tue, 05 May 2009 11:45 Go to previous message
Eclipse UserFriend
Originally posted by: night.roger.gmail.com

When row mapping is /root or //root, there is definitley only one row
returned.

--
Thanks,
Wenjie
"JS" <asd@asd.com> wrote in message news:gtor10$l5f$1@build.eclipse.org...
> Ok but the point was that the rowmapping was not allowed to change from
> eg:
>
> /root
> or
> //root
>
>
>
> "Wenjie Tu" <night.roger@gmail.com> wrote in message
> news:gtol3c$ivn$1@build.eclipse.org...
>> Row xpath: /root/head/section/subsection/item/data[@id="D1"]
>> Column xpath: /@value
>>
>> --
>> Thanks,
>> Wenjie
>>
>> "JS" <asd@asd.com> wrote in message
>> news:gtnnb6$e8s$1@build.eclipse.org...
>>>I have this XML:
>>>
>>> <root id="root" >
>>> <head>
>>> <section secid="section">
>>> <subsection>
>>> <item order="0">
>>> <data id="D1" value="red"/>
>>> <data id="D2" value="blue"/>
>>> </item>
>>> <item order="1">
>>> <data id="D1" value="green"/>
>>> <data id="D2" value="yellow"/>
>>> </item>
>>> <item order="2">
>>> <data id="D1" value="black"/>
>>> <data id="D2" value="white"/>
>>> </item>
>>> </subsection>
>>> </section>
>>> </head>
>>> </root>
>>>
>>> Now I would like to extract all values where id=D1, which should result
>>> in:
>>>
>>> red
>>> green
>>> black
>>>
>>> I have defined the rowmapping:
>>>
>>> /root
>>>
>>> and this column mapping:
>>>
>>> /head/section/subsection/item/data[@id="D1"]/@value
>>>
>>> But the result is only:
>>>
>>> red
>>>
>>> instead of:
>>>
>>> red
>>> green
>>> black
>>>
>>> Any ideas on how to get values from the remaining item/data elements
>>> (without changing the rowmapping!)?
>>
>>
>
Previous Topic:First row on page...
Next Topic:Warning when including image
Goto Forum:
  


Current Time: Thu Mar 28 08:08:46 GMT 2024

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

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

Back to the top