cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Kavanagh <...@dotech.com>
Subject Re: Stopping a SAX parser
Date Thu, 06 Nov 2003 16:58:55 GMT
Interesting. I was under the assumption that the content handler events 
were synchronous, so the processing could be interrupted by calling 
endDocument(). Doesn't the pipeline get recycled at this point? I 
thought that a generator would stop processing when it gets a life cycle 
event to clean up.
This was my expectation, but I haven't looked at the code (which is 
always the last word!)

David

Bruno Dumon wrote:

>On Thu, 2003-11-06 at 17:36, David Kavanagh wrote:
>  
>
>>If I'm not mistaken, you can call endDocument() in your own
>>transformer at any time. That effectively puts an end to pipeline
>>processing.
>>    
>>
>
>But that won't stop the parser from parsing the rest of the file and
>pushing SAX events out.
>
>The only way of stopping a SAX-parser is throwing an exception.
>
>Using a pull-parser you can decide yourself when you stop reading.
>
>  
>
>> Hopefully, at that point, you've also genereated events for some
>>sending some data out of your transformer!
>>
>>David
>>
>>jcplerm wrote:
>>    
>>
>>>I'm not sure which list to post this question to, but maybe one of
>>>you know if it's possible at all to stop a SAX parser once the
>>>immediate content handler finds whatever info it is looking for, in
>>>order to avoid unnecessary parsing of the rest of a potentially
>>>large XML document?
>>> 
>>>Thanks,
>>> 
>>>jlerm
>>>      
>>>

Mime
View raw message