From: Jimmy Z. <cra...@co...> - 2007-03-01 04:29:25
|
I need to give that some thought... ----- Original Message ----- From: "Rodrigo Cunha" <rn...@gm...> To: "Mark Swanson" <ma...@Sc...> Cc: <vtd...@li...> Sent: Wednesday, February 28, 2007 7:20 PM Subject: Re: [Vtd-xml-users] Random Access Proposal (take 2) > Nah... given what i understand about the internal structure making it > the new document root is not trivial, i think. > > But you could get away with: > > - A bookmark/position saving system, aka the (in)famous SimpleContext > class?... > > - A function evaluating: > > boolean SimpleContext.isSunOf(Simplecontext ctx); //this should be > simple and efficient to implement > > Regards, > > Rodrigo > > Mark Swanson wrote: >> Rodrigo Cunha wrote: >>> For a SimpleContext, or something similar: >>> >>> The comparison operator could just compare the arrays containing the >>> internal state of Navigator. >>> >>> The hashcode would be the XOR of all elements in the array, that >>> implements java hashcode and equals in a compatible way with the >>> assumed rules in java libraries. >>> >>> Jimmy, I think my "SimpleContext" or whatever you want to call it, if >>> properly implemented and perhaps with a few extra functions could >>> solve all the problems of random access. >>> >>> I think we just want something with the functionality of push() and >>> pop() but that can be extracted and kept outside, memorizing the >>> equivalent of a single stack position, and perhaps with a bit more >>> functionality. >> >> It will be interesting to see how much / little info we can get away >> with saving and still be able to start an XPath expression from an >> arbitrary point. >> >> Important: it may make the implementation easier if we make the >> arbitrary starting point the new document root - just for xpath >> evaluation purposes. I think this is perfect, actually. I don't want >> anything except for the node and its children - that's why I'm >> explicitly pointing there in the first place. >> >> F.E. >> (forgive the illegal simplified syntax..) >> >> aaa >> bbb >> ccc <- Index saved, new root for xpath eval. >> eee >> fff >> /ccc >> dd >> ... >> >> I'd want to say something like this: >> >> vtdNav.toElement(cccIndex); // reset cursor to ccc >> ap.selectXPath("/ccc/*") >> >> Cheers. >> > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share > your > opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Vtd-xml-users mailing list > Vtd...@li... > https://lists.sourceforge.net/lists/listinfo/vtd-xml-users > |