[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: how to skip parsing of a subtree?

  • To: "Steven J. DeRose" <sderose@a...>, xml dev <xml-dev@l...>
  • Subject: Re: how to skip parsing of a subtree?
  • From: Anil Philip <goodnewsforyou@y...>
  • Date: Mon, 10 Oct 2005 07:30:33 -0700 (PDT)
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=q2/sILQjbv8eCpv5BaxK2nI1WSeRGynH8kZVUHHVGjdZ8RJRf7E4TxUzP7dQDejWoEaN+IeqdL6fmSulOe3IQdK1Q9sIBRe3SB9L4qhx6vDUv6g/Ip9zCXiB68iUlbw6WhV7ZWrfX/yFRSbCg0P9Uqu93ylsNxQ4qquWwNaG/UY= ;
  • In-reply-to: <a0611040cbf70227e5354@[192.168.0.0]>

Re:  how to skip parsing of a subtree?
Thanks for replying.
I am ok with parsing up to it. How do you shut down
the parser? I see no shutdown/stop call in XMLReader.

This is the way I had planned to implement looking for
a node, but it will not stop the unnecessary parsing.
In startElement() at the very beginning:

 if (qualifiedName.equalsIgnoreCase("Node")) {
  if(!inRequiredSubtree) {
    if(idToLookFor == id)
      inRequiredSubtree = true;
    else {
         return;
    }
  }
...process
}

In endElement():
if (qualifiedName.equalsIgnoreCase("Node")) {
  if(id == idToLookFor) {
   inRequiredSubtree = false; 
   return;
  }
  if(inRequiredSubtree) {
...process
  }
}

thanks,
Anil

--- "Steven J. DeRose" <sderose@a...> wrote:

> At 06:46 -0700 2005-10-10, Anil Philip wrote:
> >Hello,
> 
> Skipping the part *after* the subtree you want is
> easy: just shut 
> down the parser.
> 
> Skipping the part *before* may be hard. If your tree
> is headed by
> 
>     <foo nodeID='65536'>...
> 


for good news go to http://members.tripod.com/~goodnewsforyou/goodnews.html


	
		
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.