Just to get it right:
my pipeline will then consist of
- the generator, which I have to implement for fetching the XML directly
from the database
- the XSLT transfomer which creates the XHTML with the short list consisting
of the hyperlinks to the detailed pages and the navigational elements (prev,
next)
- the HTML serializer

Some questions remain (at least for me):
- Should the generator produce 1 XML (including the various 'XML rows' from
the database and maybe a tag for the PREV and the NEXT) or should it produce
a series of XMLs (1 for each record from the DB)?

- Can I somehow make the query (results) persistent for the PREV/NEXT
mechanisms? Does this have to be done in the generator?

Thanks
Kurt

-----Ursprüngliche Nachricht-----
Von: Ugo Cei [mailto:[EMAIL PROTECTED]]
Gesendet: Dienstag, 17. September 2002 14:19
An: [EMAIL PROTECTED]
Betreff: Re: Integrating XML formatted information directly with
navigational structures


Majcen, Kurt wrote:
> Hi all!
> 
> I'm rather new with Cocoon but I think I've got a somehow tricky question:
> 
> In my ORACLE database XML formatted records are stored e.g. for users
(also
> for other types of records but these are the easy ones I want to try with)
> in CLOB fields - so the record could look like:

<snip/>

I'd use a generator instead of an action. No need to store the retrieved 
XML in a file and read it again via XSP.

You can find an example here [1]. I'll comment the relevant parts:

PreparedStatement ps = ...;
ResultSet rs = ps.executeQuery(); // execute query and retrieve the 
result set
while (rs.next()) {
   // CONTENT is the CLOB column
   insertXML(rs.getClob("content").getCharacterStream(), parser);
}
...

// The insertXML method parses the CLOB column as XML and inserts
// it as SAX events in the pipeline.

private void insertXML(Reader reader, Parser parser)
   throws SAXException, IOException
{
   InputSource is = new InputSource(reader);
   parser.parse(is, new IncludeXMLConsumer(xmlConsumer));
}

I hope this is helpful and correct.

        Ugo

[1]: 
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/cocoblog/CocoBlog/src/java/co
m/beblogging/generation/RSSGenerator.java?rev=1.1&content-type=text/vnd.view
cvs-markup

-- 
Ugo Cei - http://www.bebloggging.com/blog/


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.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/faq/index.html>

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

Reply via email to