At 04:12 PM 11/13/01 -0800, you wrote:
> > 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)?



I don't know.  I've never had to do this.

Frank Taffelt had a suggestion a while back:

"alternatively you can let your ContactBO return either an
* org.w3c.dom.Node that represents your BO in a DOM
* object that implements org.apache.cocoon.xml.XMLizable for generating
SAX-Events according to your BO-Data"

What he means is that <xsp:expr> can accept a Node, or an XMLizable object too - not 
just a string.  I don't know offhand if Document, DocumentFragment, or DOMSource are 
subclasses/subinterfaces of these objects.  You'll have to look into that yourself.


Take a look at this:

http://xml.apache.org/cocoon2/apidocs/org/apache/cocoon/components/language/markup/xsp/XSPObjectHelper.html

Note the massively overloaded xspExpr() method.  A call to this method is what gets 
generated every time you use <xsp:expr>.  So <xsp:expr> can be used with any type of 
object that there is a xspExpr method for.


So the options were either to call <util:include-expr> with a string (which will be 
parsed into XML), or to call <xsp:exp> with one of the objects mentioned (Node, or 
XMLizable).  Or to create a Generator.


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]>

Reply via email to