cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Neary <>
Subject Re: Passing document, request & resonse to other methods
Date Tue, 02 Oct 2001 09:28:01 GMT
Adrian Geissel wrote:
> Hi Dave,
> why not just let the XSP processor create the DOM nodes - and use the
> <xsp:logic/> and <xsp:expr/> tags to embed functionality in the output.
> If you need to control the addition of elements to the DOM in your own code,
> then use the <xsp:element/>, <xsp:attribute/> and <xsp:content/> tags
> they'll be properly resolved, less coding and fewer errors as a result (and
> C2 SAX-based compatibility for free!).

The issue was merging XML from outside sources (database) into the
document - and apparrently the best way to do that is with the context
node (xspParentNode, xspCurrentNode), rather than doing stuff directly
with the document (which makes sense).

An example of what I was trying to do is...

<xsp:page language="java"


  void insertNode(Document doc, Node current, int object_id)
    SQLQuery sqlq = new SQLQuery();
    Node my_xml = sqlq.getObjectById(object_id);
    // Or something similar... this is a rough sketch

    String []objstrings= request.getParameterValues("object_id"); 
    int object_id = Integer.valueOf(objstrings[0]);
    insertNode(document, xspCurrentNode, object_id);

Thanks for the help,

David Neary,               E-Mail
Palamon Technologies Ltd.  Phone +353-1-634-5059

Please check that your question has not already been answered in the
FAQ before posting. <>

To unsubscribe, e-mail: <>
For additional commands, e-mail: <>

View raw message