You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by ba...@apache.org on 2001/01/16 08:02:10 UTC

cvs commit: xml-cocoon/src/org/apache/cocoon/processor/xsp/library/java util.xsl

balld       01/01/15 23:02:10

  Modified:    src/org/apache/cocoon/processor/xsp/library/java util.xsl
  Log:
  added method stuff
  
  Revision  Changes    Path
  1.22      +43 -0     xml-cocoon/src/org/apache/cocoon/processor/xsp/library/java/util.xsl
  
  Index: util.xsl
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/processor/xsp/library/java/util.xsl,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- util.xsl	2000/12/11 11:33:22	1.21
  +++ util.xsl	2001/01/16 07:02:10	1.22
  @@ -263,6 +263,49 @@
       </xsp:expr>
     </xsl:template>
   
  +  <xsl:template match="util:get-encoding">
  +    <xsl:variable name="encoding">
  +      <xsl:choose>
  +        <xsl:when test="@encoding">"<xsl:value-of select="@encoding"/>"</xsl:when>
  +        <xsl:when test="util:encoding">
  +          <xsl:call-template name="get-nested-content">
  +            <xsl:with-param name="content" select="util:encoding"/>
  +          </xsl:call-template>
  +        </xsl:when>
  +      </xsl:choose>
  +    </xsl:variable>
  +    <xsp:expr>new String(<xsl:apply-templates/>,String.valueOf(<xsl:copy-of select="$encoding"/>).trim())</xsp:expr>
  +  </xsl:template>
  +
  +  <xsl:template match="util:generate-method-header">
  +    private <xsl:value-of select="@returns"/>
  +    <xsl:text> </xsl:text>
  +    <xsl:value-of select="@name"/> (
  +      Node xspParentNode,
  +      Node xspCurrentNode,
  +      Stack xspNodeStack,
  +      Document document <xsl:for-each select="//xsp:variable">
  +        <xsl:text>, </xsl:text>
  +        <xsl:value-of select="@type"/>
  +        <xsl:text> </xsl:text>
  +        <xsl:value-of select="@name"/>
  +        <xsl:if test="@value">
  +          <xsl:text> = </xsl:text>
  +          <xsl:value-of select="@value"/>
  +        </xsl:if>
  +      </xsl:for-each>
  +      ) throws Exception 
  +  </xsl:template>
  +
  +  <xsl:template match="util:call-method">
  +    this.<xsl:value-of select="@name"/>(xspParentNode,xspCurrentNode,xspNodeStack,document
  +    <xsl:for-each select="//xsp:variable">
  +      ,<xsl:value-of select="@name"/>
  +    </xsl:for-each>
  +    )
  +  </xsl:template>
  +
  +
     <!-- Standard Templates -->
     <xsl:template name="get-nested-content">
       <xsl:param name="content"/>