|
From: Yu Z. <j_y...@ya...> - 2013-01-08 22:04:25
|
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) "<root><e1></e1></root>" with xpath "/root/e1" will yield "<e1></e1>"; 2) "<root><e1>aaa</e1></root>" 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. |