-----Oprindelig meddelelse-----
Fra: David Rosenstrauch [mailto:[EMAIL PROTECTED]]
Sendt: 13. november 2001 06:14
Til: [EMAIL PROTECTED]
Emne: Re: SV: SAX tree?

>>
(http://www.aoindustries.com/docs/cocoon-1.8.2/faqs.html#faq-xspinsertxml)
>> it seemed (to me anyway) that I could give C2 a DOM/SAX source directly,
and
>> C2 then could work on this. Can I, and how?

> It doesn't seem to me that this link indicates you can "give C2 a DOM/SAX
source directly".

> It outlines your options as:

> 1) use <util:include-expr> (which I suggested to you the other day and
which you said
> worked - not sure why you're not still using it).  Drawback is that this
invokes a parser
> to create a DOM object, and so you pay a performance penalty.

Well I thought it worked, until I tried to call more than one URL (see my
desprate mail).

> 2) Pass in a DOM object you've already created some other way.  This way
you don't need
> to invoke the parser.  One suggestion they give for doing this is to
create a
> XMLFragment, which can be converted to both DOM and SAX easily.

But how? I tried to return a Document, DocumentFragment and a DOMSource
directly to Cocoon with no sucess. I dont want to use any Cocoon specific
classes in my own framework (this may be stupied, but it's not entirely up
to me). Ok then I might be able to use the inner class you mailed me, but I
cant seem to find the "XMLFragment", what to import? Should it meybe be the
Cocoon XML fragment defined in the "old" example URL (the site is down right
now, and I cant remember the name)?

Best regards
Søren

> I don't see any other implication in there (like you can pass in a SAX
object).


>Ok - If not, what to do then? How do I do the things you talk about (the
>offical writer that can write to the xsp page, or even better, the parent
>SAXHandler for the xsp page)? The XML I return is actually a XML fragment,
>and is only part of a bigger XML document C2 should process.
>
>Basicly I don't know what to do, so please aid me :)
>
>Mvh/Best regards
>Søren


OK.  Let's take a step back.

The reason why this is so hard is that what you're doing is pretty
unorthodox.

Why are you using XSP to feed in a large amount of XML that's coming from
elsewhere?  That's not really what XSP is intended for.  It's intended to
run logic on your XML data.

Instead, why don't you create a Generator to generate that XML.  Your
generator would get XML from your Controller and feed it into the pipeline.
Then have a stylesheet or XSP process it.  Seems to me to make a lot more
conceptual sense.  And generators deal with all the SAX stuff much easier
than XSP.


HTH.

DR


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

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




---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

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

Reply via email to