Share

Whitebeam Web Application Server

Tracker: Bugs

7 Error in XPath string function - ID: 2187949
Last Update: Settings changed ( peterw8102 )

Thanks to William Vambenepe (Oracle) for spotting this.

The bug is best illustrated in the Whitebeam web-site XPath test-bed.
Execute the XPath expression :
string(/parent/child/@id)

on the default document. The node-set within the string function will
contain three nodes. According to the XPath spec, the 'strong()' function
on a NodeSet should return the string value of the first node in the set
(in document order). Whitebeam currently takes the value of the *last*
node.


Peter Wilson ( peterw8102 ) - 2008-10-22 23:35

7

Closed

Accepted

Peter Wilson

Presentation Engine

1.2 release

Public


Comment ( 1 )




Date: 2008-10-22 23:45
Sender: peterw8102Project Admin

common/XPath/XmlPathUtils.cxx contains the CrbXmlElementSet::ToString
method. This loops through the NodeSet looking for the first non-NULL node.
Having found the node it should then convert that to a string *then* exit
the loop. Instead it continues until all nodes are processed, writing the
string value of each to the output string.

Fixed with a 'break' after extracting the first string.


Log in to comment.

Attached File

No Files Currently Attached

Changes ( 3 )

Field Old Value Date By
status_id Open 2008-10-22 23:45 peterw8102
resolution_id None 2008-10-22 23:45 peterw8102
close_date - 2008-10-22 23:45 peterw8102