Hi!

I would first generate the data(featured article) and then format it with
xslt. Another way would be to generate the content-page, then include the
data one time, and then format it with xslt. I have pipelines with up to
four xslt-transformations, because I think that's faster(especially if you
don't use params in the xslt) than multiple queries to a db.

Yes, and you can put xinclude in the content page, take a look at the
Xinclude-transformer.

Best Regards

Axel


-----Original Message-----
From: Sreedhar Chintalapaty [mailto:[EMAIL PROTECTED]]
Sent: Sunday, March 17, 2002 4:07 PM
To: Cocoon Users
Subject: XInclude - optimization/alternatives to


Hi all,

I am using XInclude to process a content page and place the title, author,
and article into different cells in a table.

Content File: featuredArticle.xml
<?xml version="1.0" encoding="UTF-8"?>
<xsp:page xmlns:xsp="http://apache.org/xsp";
xmlns:xsp-request="http://apache.org/xsp/request/2.0";
xmlns:dbtags=http://gvs/dbtags>
    <page>
        <title>Fall in New Hampshire</title>
        <writer>The Itinerant Monk</writer>
        <article>
            blah-blah-blah
            List of Hiking Trails
            <dbtags:get-list-of-trails/>
        </article>
    </page>
</xsp:page>
Style Sheet: formatter.xsl
<table>
    <tr>
        <td class="title">
            <xinclude:include
href="http://localhost/cocoon/gvs/xsp/{$tab}/{$request-url}#xpointer(//title
)"/>
        </td>
    </tr>
    <tr>
        <td class="title">
            <xinclude:include
href="http://localhost/cocoon/gvs/xsp/{$tab}/{$request-url}#xpointer(//autho
r)"/>
        </td>
    </tr>
    <tr>
        <td class="title">
            <xinclude:include
href="http://localhost/cocoon/gvs/xsp/{$tab}/{$request-url}#xpointer(//artic
le)"/>
        </td>
    </tr>
</table>

This does what I want it to do, but at a cost: The -entire-
featuredArticle.xml is loaded three times, parsed three times and, for the
get-list-of-trails tag, the database is queried three times - you get the
picture.

There must be a better way to do something like this... I would appreciate
any suggestions/advice/pointers...

Thanks, and Best Regards,

Sreedhar Chintalapaty
____________________________________________________________________________
______________
A computer is like an Old Testament god, with a lot of rules and no mercy -
Joseph Campbell


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