OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: [xml-dev] how to skip parsing of a subtree?

[ Lists Home | Date Index | Thread Index ]
  • To: "Steven J. DeRose" <sderose@acm.org>, xml dev <xml-dev@lists.xml.org>
  • Subject: Re: [xml-dev] how to skip parsing of a subtree?
  • From: Anil Philip <goodnewsforyou@yahoo.com>
  • 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]>

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@acm.org> 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




 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS