From: Jimmy Z. <cra...@co...> - 2006-06-14 06:50:26
|
Similar issues have been raised before, yes we are still thinking about = that...=20 original design goal is to keep as much complexity out of the = implementation as possible, the problem of=20 multiple context object is that once we give people more than one = cursor, people will want even more,=20 potentially making position tracking difficult ... the goal is KISS, = keep it simple and stupid... regarding LC entry, yes, there is a way, but requires hacking on your = side, also for nodes that goes beyond depth 4, linear scan is used to locate child nodes... so the best/simplest way is to wrap around vn.toElement(FIRST_CHILD).... it will take care of everything...=20 ----- Original Message -----=20 From: Aakash Jain=20 To: Jimmy Zhang=20 Sent: Tuesday, June 13, 2006 11:28 PM Subject: Re: multiple context objects In place of providing multiple context object, it can provide context = save and load methods. Currently it provides push and pop methods that = operate on VTD's stack only. But the user cannot save and load the = context in his defined stack or some other array.=20 Regarding the hasChild() problem: The lower 32 bits in LC entry contains -1 if there is no child of a = node. Is there a way to access that entry. Because this will be a = straight forward check to know if the node has child or not.=20 --=20 Aakash Jain PUCSD Ph : 91 9844223652=20 " There are 10 types of people in this world, those who understand = binary and others who don't. " On 6/14/06, Jimmy Zhang <cra...@co...> wrote: Sorry for the late reply... right now VTD-XML doesn't implement multiple context object, because = a context object is a global variable so you can use it across procedures... = and we have yet to come across a scenario where multiple context object is needed...=20 the best way to check whether a node has child or not is navigate to = it and check the result value... if (vn.toElement(VTDNav.FC) =3D=3D false) {// no child } else { vn.toElement (VTDNav.P); // return to the orginal node // has child... } let me know if there is any further question... |