cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christopher Painter-Wakefield" <>
Subject Re: [c1]<esql:get-int ...> as param for <xsl:call-template ...>
Date Thu, 16 Aug 2001 14:52:21 GMT


you are mixing two different things.  Keep in mind that when you are
writing a logicsheet, you are writing an XSLT stylesheet that will
transform based only on what is available to it in your XML file.  This
happens once and only once, statically, to generate Java code which will
then be compiled.  The output of the Java code will then be run to produce
the actual XML which feeds into the rest of the pipeline (stylesheets and
so forth).

The ESQL taglib is also a logicsheet, so it produces Java code.  The
results of the <esql:get-int ...> operation won't be available until after
it is transformed by the esql logicsheet into Java code, compiled, then
run.  Your logicsheet, however, is trying to use the result long before any
of that happens.  In other words, you are not passing the results of a
database operation as a parameter into your <xsl:call-template>, you are
passing XML that happens to look like <esql:get-int ...>.  Or, if the esql
logicsheet happens to be applied first, then you are passing Java code,
*not* the results of running that code.

Hope this helps.


Please respond to

To:   <>

Subject:  [c1]<esql:get-int ...> as param for <xsl:call-template ...>

Hi all,

    I want to get something like this:

<elem id="top_el_id">
    <sub_elements count="sub_cnt">
        <elem id="sub_el_id_1"></elem>
        <elem id="sub_el_id_2"></elem>
        <elem id="sub_el_id_3"></elem>
        <elem id="sub_el_id_4"></elem>

XML file:
<?xml version="1.0" encoding="iso-8859-2"?>
<?xml-logicsheet href="my_taglib.xsl"?>
<?cocoon-process type="xsp"?>
    <my_taglib:loc id="1"/>

logcsheet: my_taglib.xsl:
<?xml version="1.0" encoding="iso-8859-2"?>
<xsl:stylesheet version="1.1"


    <xsl:template match="xsp:page">

    <xsl:template match="my_taglib:loc" name="loc-tag">
        <!-- selecting data from DB, based on parameter id,
            parameter id is set to attribute id if attribute id is valid
            if element has any subelements, i want them to be in
            but ids of this subelements are stored in DB and are depending
on id of current
            element, so i try: -->

        <xsl:call-template name="loc-tag">
            <xsl:with-param name="id"><esql:get-int

        <!-- unfortunetly <esql:get-int column="sl"/> is not substituted
with any value
            and i get infinite recursion, beacause if id param or attribute
are not provided
            i try to work, and process all elements in DB, but some
have subelements,
            and again <xsl:call-template name="loc-tag"> with no param -->

I think error may be in order of inclusion taglibs, but can't find good

Thanks in advance,

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