|
[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] 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! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|
|||||||||

Cart








