|
From: Mohit A. <moh...@gm...> - 2012-10-26 17:31:48
|
Thanks I'll try this option.
On Mon, Oct 15, 2012 at 12:57 PM, <jz...@xi...> wrote:
> I like Ruben's second way better than first, because it is faster
>
>
>
> ----- Original Message -----
> From:
> Rubén Akagi <mae...@gm...>
>
> To:
> "Mohit Anchlia" <moh...@gm...>
> Cc:
> <vtd...@li...>
> Sent:
> Mon, 15 Oct 2012 01:08:42 -0300
> Subject:
> Re: [Vtd-xml-users] Recursively parsing xml
>
>
>
> Hi, this is what I use to do (considering only the element nodes):
>
> public void recursive(VTDNav nav) throws NavException{
> do{
> if (nav.toElement(VTDNav.FIRST_CHILD)){
> recursive(nav);
> nav.toElement(VTDNav.PARENT);
> }
> }while(nav.toElement(VTDNav.NEXT_SIBLING));
> }
> nav.toElement(VTDNav.ROOT);
> recursive(nav);
>
>
> This is another way. It's now a recursive function but it walks the same
> nodes at the same order:
>
> for(int i=0; i<naviagtor.getTokenCount(); i++){
> int type = navigator.getTokenType(i);
> if (type == VTDNav.TOKEN_STARTING_TAG){
> //some code
> }
> }
>
>
> Ruben.
>
> 2012/10/14 Mohit Anchlia <moh...@gm...>
>
>> What's the most effiecient way to walk the entire node recursively
>> using vtd-xml? I have tried various options using bookmark but I am not
>> sure if that's the best way. Could someone suggest?
>>
>> ------------------------------------------------------------------------------
>> Don't let slow site performance ruin your business. Deploy New Relic APM
>> Deploy New Relic app performance management and know exactly
>> what is happening inside your Ruby, Python, PHP, Java, and .NET app
>> Try New Relic at no cost today and get our sweet Data Nerd shirt too!
>> http://p.sf.net/sfu/newrelic-dev2dev
>> _______________________________________________
>> Vtd-xml-users mailing list
>> Vtd...@li... <Vtd...@li...>
>> https://lists.sourceforge.net/lists/listinfo/vtd-xml-users
>>
>>
>
|