[Home]  [List]  [News]  [Docs]  [FAQ]  [Downloads]  [Resources]  [About]
Search :
/Home /List

list4xt : Mailing list for the XT users community.

[list4xt] Re: How do you set the XSLProcessor as a DocumentHand

Subject: [list4xt] Re: How do you set the XSLProcessor as a DocumentHand
From: Sebastien Sahuc (ssahuc@imediation.com)
Date: 29/08/2000 - 13:50


> Sebastian,

> Sebastien Sahuc wrote:
> >
> > Eric,
> >
> > Thank for your prompt reply, but I'm still confused in how I can do that
> > simply by setting the parser.
> >
> > Indeed after calling the setParser(), the only XML source you can feed
> > the XSL processor with is through the method parse() which take an
> > InputSource as argument. Which is not what I want. I would be more
> > interested in getting back somehow the DocumentHandler instance on which
> > I'll fire 'by hand' the SAX events (docHandler.startElement(...) ,
> > etc...) . Does it make sense ?

> After you've set the parser (through setParser), the class you'll have
> installed will receive a call to its setDocumentHandler method and the
> docHandler will be passed as a parameter.

> Then it will receive a parse method call which will send the sax events
> to the docHandler previously installed...

Unfortunately, Cocoon2 uses a push model concerning the SAX events, which
mean that once you're on the OwnParserInstance.parse () method, you have
no option (so far I've understood cocoon engine) for asking cocoon engine
to start firing SAX events. That's the reason why I prefered to
copy/paste the XSLProcessorImpl and split the XMLProcessorImpl.load()
method in two part, one to set the Builder (DocHandler) and one that
extract the RootNode from the builder when sax events have been totally
fired.

Do it make sense ?

All the best,

Sebastien

PS: I wish to thanks James Clark for the impressive work you've done with
XT, it's a piece of art. BTW Is there any -small- documentation
explaining briefly how XT peforms so fast -moreover not being optimized
so far-.

> You have an example of this in the RSS 1.0 tools I have published of
> 4xt.

> See:

> /downloads/rss/text-to-10.txt
> /downloads/rss/TextDriver.java
> /downloads/rss/TextSAXParser.java
> /downloads/rss/DefaultSAXParser.java

> Hope this helps.

> Eric
> >
> > Thanks,
> >
> > Sebastien
> >
> > >>>>>>>>>>>>>>>>>> Original Message <<<<<<<<<<<<<<<<<<
> >
> > On 8/25/00, 6:28:41 PM, Eric van der Vlist <vdv@dyomedea.com> wrote
> > regarding [list4xt] Re: How do you set the XSLProcessor as a
DocumentHand:
> >
> > > Sebastien,
> >
> > > Sebastien Sahuc wrote:
> > > >
> > > > Hello,
> > > >
> > > > I wonder how do you set the XSLProcessorImpl as a DocumentHandler.
> > > >
> > > > Indeed I'm receiving SAX events from a SAX producer (Cocoon2 filter to be
> > > > more precise), and I would like these SAX events to feed a XSLPRocessor
> > > > instance. Am I asking the right question ? If so is it possible to do it
> > > > simply.
> >
> > > If I understand your question correctly,
> >
> > > xsl.setParser((Parser)sourceParser, (Parser)sheetParser );
> >
> > > should do the trick.
> >
> > > The only thing to note is that Parser is a SAX1 parser and that if you
> > > want to plug a SAX2 parser you should either use the compatibility class
> > > provided with SAX2 or implement both SAX1 and SAX2 (AElfred2 is a good
> > > example of such an implementation).
> >
> > > > In fact I'm trying to write an Filter for the cocoon2 project, and I know
> > > > Eric to be on the cocoon list, would you help me ?
> >
> > > Of course !
> > > (even if I wasn't on the cocoon list :)
> >
> > > > Thanks in advance,
> >
> > > Hope this helps.
> >
> > > Eric
> >
> > > > Sebastien
> > > >
> > > > --
> > > > Mailing list for the XT users community. (http://forwc.org)
> > > > (mailto:list4xt-request@4xt.org?Subject=unsubscribe to unsubscribe)
> >
> > > --
> > > ------------------------------------------------------------------------
> > > Eric van der Vlist Dyomedea http://lthosting.com
> > > http://entrustbankcard.com - http://creditcardprocessing101.com http://merchantaccountagentprogram.com
> > > ------------------------------------------------------------------------
> >
> > > --
> > > Mailing list for the XT users community. (http://iblbuilder.com)
> > > (mailto:list4xt-request@4xt.org?Subject=unsubscribe to unsubscribe)
> >
> > --
> > Mailing list for the XT users community. (http://cosb1.org)
> > (mailto:list4xt-request@4xt.org?Subject=unsubscribe to unsubscribe)

> --
> ------------------------------------------------------------------------
> Eric van der Vlist Dyomedea http://wiscrest.org
> http://merchantaccountsreview.com - http://electroniccigarettemerchantaccount.com http://oswegocountyfcu.org
> ------------------------------------------------------------------------

> --
> Mailing list for the XT users community. (http://millstonenjhomes.com)
> (mailto:list4xt-request@4xt.org?Subject=unsubscribe to unsubscribe)

--
Mailing list for the XT users community.     (http://premierbanknc.com)
(mailto:list4xt-request@4xt.org?Subject=unsubscribe to unsubscribe)



Archive générée par hypermail 2b28 le 06/11/2001 - 11:46 CET

webmaster@4xt.org


A site designed by Dyomedea