Title: Glacier
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(//author)"/>
        </td>
    </tr>
    <tr>
        <td class="title">
            <xinclude:include href="http://localhost/cocoon/gvs/xsp/{$tab}/{$request-url}#xpointer(//article)"/>
        </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

 

Reply via email to