cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vadim Gritsenko <va...@reverycodes.com>
Subject Re: Streaming strings in JXTemplate
Date Mon, 23 May 2005 14:02:42 GMT
Leszek Gawron wrote:
> Vadim Gritsenko wrote:
> 
>>> The main reason for using DOM in some cases (chosen by user at 
>>> runtime) is the ability to avoid SAXException. SaxBuffer does not 
>>> offer such functionality as it just stores sax bits and does not 
>>> check if xml is well formed.
>>
>> And neither does DOM. So can you explain your point or give an example?
> 
> I'd like to implement something like:
> <jx:out value="${str}" xmlize="true" lenient="true"/>
> 
> If @lenient="true":
> 
> 1. cache SAX events from parsed ${str}
> 2. validate SAX stream somehow for well formedness (that is why I 
> proposed DOM)
> 3. play SAX events into the main stream only if no SAXException occured 
> previously.
> 
> Right now parsing a not well formed xml fragment into view's SAX stream 
> will destroy the view completely.

So you can use SAXBuffer. Parse into it, parser will check wellformedness (see 
samples/errorhandling/error-giving-page.xml).

Vadim

Mime
View raw message