You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Hubert NEOtyk Iwaniuk <hu...@office.ferienwelt.com.pl> on 2001/08/16 14:30:26 UTC

[c1] as param for

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>
    </sub_elements>
</elem>

XML file:
<?xml version="1.0" encoding="iso-8859-2"?>
<?xml-logicsheet href="my_taglib.xsl"?>
<?cocoon-process type="xsp"?>
<xsp:page
    xmlns:my_taglib="http://my_host/my_taglib"
    xmlns:xsp="http://www.apache.org/1999/XSP/Core"
    xmlns:esql="http://apache.org/cocoon/SQL/v2">
    ...
    <my_taglib:loc id="1"/>
    ...
</xso:page>

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

    xmlns:my_taglib="http://my_host/my_taglib"
    xmlns:esql="http://apache.org/cocoon/SQL/v2"
    xmlns:xsp="http://www.apache.org/1999/XSP/Core"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

    <xsl:template match="xsp:page">
        ...
    </xls:template>

    <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
number,
            if element has any subelements, i want them to be in sub_element
tag,
            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
column="sl"/></xsl:with-param>
        </xsl:call-template>

        <!-- 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 elements
have subelements,
            and again <xsl:call-template name="loc-tag"> with no param -->
    </xsl:template>

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

Thanks in advance,
    Hubert.


---
Ausgehende Mail ist zertifiziert virenfrei.
Uberpruft durch AVG Antivirus System (http://www.grisoft.com/de).
Version: 6.0.265 / Virendatenbank: 137 - Erstellungsdatum: 2001-07-18


---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>