|
From: <jz...@xi...> - 2013-01-09 04:35:41
|
Yes, it is a change of behavior in the latest version, it is not supposed to return -1, it should return a text node of zero width, you should adjust your app accordingly... ----- Original Message ----- From: Yu Zhou To:"vtd...@li..." Cc: Sent:Tue, 8 Jan 2013 14:04:17 -0800 (PST) Subject:[Vtd-xml-users] VTDNav.getText() issue? Previously, actually very old version, we use VTDNav.getText() [1] to determine whether we have some text value, if not we get the whole element for further processing, e.g. 1) "" with xpath "/root/e1" will yield "";2) "aaa" with xpath "/root/e1" will yield "aaa". Basically, we use selecXPath(xpath) and evalXPath(), then if VTDNav.getText() [2] return -1, we grab the whole element; otherwise, we use vtdNav.toNormalizedString(vtdNav.getText() [3] to get the text value. However, in the current version of VTD, when we use the vtdNav.getText() [4] on above two examples, we get number 3 for both cases. However, we'd expect -1 for the case #1 and 3 for case #2. Really appreciate if somebody could help promptly address this issue. Links: ------ [1] http://sitemail.hostway.com/http: [2] http://sitemail.hostway.com/http: [3] http://sitemail.hostway.com/http: [4] http://sitemail.hostway.com/http: |