On Tue, 2003-11-25 at 19:53, Upayavira wrote:
> Bruno Dumon wrote:
> 
> >On Mon, 2003-11-24 at 22:47, Sebastian Klamar wrote:
> >  
> >
> >>I want to add some information to <img> links inside a document.  In my
> >>special case this information is the size of the image.  The difficult
> >>thing is that it's not the current (static) file size of the image.
> >>Instead of the image has to be processed by a Reader (transforms JPEGs
> >>into WBMPs, makes resizing etc.), so the image size is varying.  So the
> >>image has to be processed by Cocoon before you can calculate the size.
> >>
> >>Now my question to you.  How can I aquire the information in question
> >>inside the transformer?  With Flow's processPipelineTo() you can process
> >>a dummy request, but only inside a flow script :-(  How can I combine
> >>SAX processing of a transformer with the control flow processing like
> >>Flow's processPipelineTo()?
> >>    
> >>
> >
> >If you're writing a custom transformer, you can use the SourceResolver
> >to resolve a cocoon: URL, which is similar to the processPipelineTo in
> >flowscript.
> >  
> >
> Yup. That's good. But a question of mine - what if you want this 
> pipeline, within your custom transformer, to feed SAX events into your 
> own content handler, so that you don't have to reparse the XML? Is that 
> possile?

yes, check if the Source implements the XMLizable interface, and if so,
use the XMLizable.toSAX method. The SourceUtil class has a convenience
method for that: SourceUtil.toSAX(Source, ContentHandler).

-- 
Bruno Dumon                             http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
[EMAIL PROTECTED]                          [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to