Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 340628

Summary: XML Data source - column mapping - xpath problem with attribute and position predicates
Product: z_Archived Reporter: Silvestr Peknik <silvestr.peknik>
Component: BIRTAssignee: Mingxia Wu <mwu>
Status: RESOLVED FIXED QA Contact: Xiaoying Gu <bluesoldier>
Severity: normal    
Priority: P3 CC: bluesoldier
Version: 2.6.1   
Target Milestone: 3.7.0 M7   
Hardware: PC   
OS: Windows XP   
Whiteboard: Obsolete
Attachments:
Description Flags
test xml none

Description Silvestr Peknik CLA 2011-03-22 02:53:44 EDT
Hello,

I have XML data source and i am creating data set. Part of the xml that i want to bind to columns causes troubles to me or to BIRT.

The problem can be demonstrated on the XML part below. When trying to select <value> element using position predicate after using attribute predicate for <custom id="2">, the XPath does not work as expected:

XML:

<item>
<customs>
<custom id="2">
<name>Rick</name>
<values>
<value>3</value>
<value>4</value>
</values>
</custom>
</customs>
</item>

/customs/custom[1]/values/value[1]
returns "3"

/customs/custom[@id="2"]/values/value[1]
does not return anything

expected: 3, since points at the same element as previous query

/customs/custom[@id="2"]/values/value
returns "3"
Comment 1 Silvestr Peknik CLA 2011-03-22 02:59:27 EDT
To reproduce:

Create XML data source over an XML that contains structure similar to the one i described

Start creating data set. In column mapping, try selecting an element using the described XPath, with attribute predicate and then position

Click "Show sample data" to check what gets returned
Comment 2 Tianli Zhang CLA 2011-04-28 04:58:36 EDT
Created attachment 194244 [details]
test xml
Comment 3 Xiaoying Gu CLA 2011-05-17 03:46:42 EDT
Fixed in 3.7.0 M7