From: <jz...@xi...> - 2013-01-10 04:16:29
|
yes ----- Original Message ----- From: Yu Zhou To:"jz...@xi..." , "vtd...@li..." Cc: Sent:Wed, 9 Jan 2013 05:42:38 -0800 (PST) Subject:Re: [Vtd-xml-users] VTDNav.getText() issue? In that case, shall we use vtdNav.getTokenLength(vtdNav.getText()) [1] == 0 to replace vtdNav.getText() [2] == -1 to determine whether we have a text value in the specific path? Thanks for prompt response. FROM: "jz...@xi... [3]" TO: 'Yu Zhou' ; 'vtd...@li... [6]' SENT: Tuesday, January 8, 2013 11:17 PM SUBJECT: Re: [Vtd-xml-users] VTDNav.getText() [7] issue? 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... [9]" Cc: Sent:Tue, 8 Jan 2013 14:04:17 -0800 (PST) Subject:[Vtd-xml-users] VTDNav.getText() [11] issue? Previously, actually very old version, we use VTDNav.getText() 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() return -1, we grab the whole element; otherwise, we use vtdNav.toNormalizedString(vtdNav.getText() to get the text value. However, in the current version of VTD, when we use the vtdNav.getText() 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.hostwaycom/http: [3] mailto:jz...@xi... [4] mailto:jz...@xi... [5] mailto:j_y...@ya... [6] mailto:vtd...@li... [7] http://sitemail.hostway.com/http: [8] mailto:j_y...@ya... [9] mailto:vtd...@li... [10] mailto:vtd...@li... [11] http://sitemail.hostway.com/http: |