Extract values from multiple elements (XML data source) [message #368104] |
Mon, 04 May 2009 21:39 |
Eclipse User |
|
|
|
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 |
Eclipse User |
|
|
|
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 |
Eclipse User |
|
|
|
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 |
Eclipse User |
|
|
|
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!)?
>>
>>
>
|
|
|
Powered by
FUDForum. Page generated in 0.02532 seconds