cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Konstantin Piroumian" <>
Subject Re: Generating XML from XSP for external use
Date Tue, 14 Nov 2000 13:15:25 GMT
> Konstantin Piroumian wrote:
> >
> > I will take a look at it. I know very little about SOAP, but it's not
what I
> > need.
> > I simply need something to get this:
> >
> > <xsp:logic>
> > Node node = getQueryDOM("<query><object type=\" +
> > request.getParameter("object") + ...); // so on
> > </xsp:logic>
> Well, if the EJB is on the same server, then you don't need SOAP :-)

No, EJBs will be on another server, but they will be available with JNDI.
I use Yvon's EJB stylesheet to access them.

> Just parse the XML, for example like this:
> StringReader strReader = new StringReader(XMLdeclaration + rootTag +
> myXMLfragment + rootEndTag);
> Document doc = xspParser.parse(new InputSource(strReader));
> strReader.close();
> Now you have a full fledged Document and can access any node to pass it
> to your EJB.

Yes, this is almost what I wanted to do.
I think that I will need a special Query class which will get request data
and return XML - something like a simplified DOM.

I was thinking also of something like this (in XSP file):
    <object type="person">

Then, get the query node from the xspDocument:
    Node node = xspDocument.getNode("query"); // it's only a sample not a
real code
    // do all processing

then remove this node from document.
This way is better for designing and changing the query DTD.

Can I get and remove nodes from the xspDocument?
Is xspDocument a Document (DOM)?
Will it cause problems in XSP?


View raw message