cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Torsten Reiners <t.rein...@tu-bs.de>
Subject Call of dynamically created tags in logicsheets
Date Thu, 14 Mar 2002 14:02:05 GMT
Hello,

we have the follogwing logicsheet where we dynamically create a tag with 
the content of the return value of a java method. The creation of the tag 
is working very well so that I did not included the Java-code in this 
example. The output in the browser is currently a file having a tag

<ownnamespace:toInsert>Content</ownnamespace:toInsert>

We thought that an <apply-templates/> would cause Cocoon to apply the 
template <ownnamespace:toInsert> being part of the logicsheet but it does 
not work for us. Is this not possible within a logicsheet to create 
dynamically tags because it was working during the later transformation 
process. If it is possible, please let us know what we have to change. If 
you need further information, please let us know so that we can provide them.

Thanks,
Torsten

<?xml version="1.0"?>

<xsl:stylesheet version="1.0"
                 xmlns:xsl="<http://www.w3.org/1999/XSL/Transform>http://www.w3.org/1999/XSL/Transform"
                 xmlns:xsp="<http://apache.org/xsp>http://apache.org/xsp"
                 xmlns:ownnamespace="<http://www.ownnamespace.org/xsl>http://www.ownnamespace.org/xsl"
                 xmlns:xinclude="<http://www.w3.org/2001/XInclude>http://www.w3.org/2001/XInclude"
                 xmlns:util="<http://apache.org/xsp/util/2.0>http://apache.org/xsp/util/2.0"
                 >


<xsl:template match="ownnamespace:header">
     <xsp:logic>

   <!-- some Java code -->
   </xsp:logic>

   <xsl:apply-templates/>
</xsl:template>


<xsl:template match="ownnamespace:link">
         <ownnamespace:toInsert>
                 <xsp:expr>getURI("<xsl:value-of 
select="@identifier"/>")</xsp:expr>
         </ownnamespace:toInsert>
         <xsl:apply-templates/>
</xsl:template>


<xsl:template match="ownnamespace:toInsert">
         <xsl:apply-templates select="document(.)" />
</xsl:template>

<xsl:template match="@*|node()" priority="-1">
         <xsl:copy>
               <xsl:apply-templates select="@*|node()"/>
         </xsl:copy>
</xsl:template>
</xsl:stylesheet>


--------------

The xsp-page which is used to call the logicsheet looks as follows

<?xml version="1.0" encoding="ISO-8859-1"?>

<xsp:page
           language="java"
           xmlns:xsp="<http://apache.org/xsp>http://apache.org/xsp"
           xmlns:ownnamespace="<http://www.ownnamespace.org/xsl>http://www.ownnamespace.org/xsl"
         xmlns:util="<http://www.apache.org/1999/XSP/Util>http://www.apache.org/1999/XSP/Util"


         xmlns:xinclude="<http://www.w3.org/2001/XInclude>http://www.w3.org/2001/XInclude"
 >
         <ownnamespace:header/>

   <page>
         <ownnamespace:link identifier="IDENTIFIER"/>
   </page>
</xsp:page>


-- 

                         __  __
                        _ OO\| O__
                         O\__/O / O
            /////        O O\ /
            O O              |
-----.oOOo------oOOo.---------------------------------
Torsten Reiners           Tel:++49-531-3913214
t.reiners@tu-bs.de        Fax:++49-531-3918144
http://server3.winforms.phil.tu-bs.de/~treiners

TU Braunschweig
Abteilung Allgemeine Betriebswirtschaftslehre,
  Wirtschaftsinformatik und Informationsmanagement
Abt-Jerusalem-Str.7
38106 Braunschweig, Germany

Other EMails:  treiners@ucdavis.edu
                     torsten.reiners@epost.de
------------------------------------------------------

Mime
View raw message