cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dirk Reiss" <d.re...@tu-bs.de>
Subject Call of dynamically created tags in logicsheets
Date Wed, 13 Mar 2002 12:17:38 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,
Dirk

<?xml version="1.0"?>

<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:xsp="http://apache.org/xsp"
                xmlns:ownnamespace="http://www.ownnamespace.org/xsl"
                xmlns:xinclude="http://www.w3.org/2001/XInclude"
                xmlns:util="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"
          xmlns:ownnamespace="http://www.ownnamespace.org/xsl"
        xmlns:util="http://www.apache.org/1999/XSP/Util" 
        xmlns:xinclude="http://www.w3.org/2001/XInclude"
>
        <ownnamespace:header/>

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


Mime
View raw message