cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ba...@apache.org
Subject cvs commit: xml-cocoon/src/org/apache/cocoon/processor/xsp/library/mail sendmail.xsl
Date Wed, 31 Jan 2001 19:19:54 GMT
balld       01/01/31 11:19:54

  Modified:    src/org/apache/cocoon/processor/xsp/library/mail
                        sendmail.xsl
  Log:
  added the c1/c2 environment switch stuff
  
  Revision  Changes    Path
  1.5       +99 -22    xml-cocoon/src/org/apache/cocoon/processor/xsp/library/mail/sendmail.xsl
  
  Index: sendmail.xsl
  ===================================================================
  RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/processor/xsp/library/mail/sendmail.xsl,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- sendmail.xsl	2001/01/31 03:59:26	1.4
  +++ sendmail.xsl	2001/01/31 19:19:50	1.5
  @@ -62,6 +62,105 @@
    version="1.0"
   >
   
  +<xsl:param name="XSP-ENVIRONMENT"/>
  +<xsl:param name="XSP-VERSION"/>
  +<xsl:param name="filename"/>
  +<xsl:param name="language"/>
  +
  +<xsl:variable name="cocoon1-environment">Cocoon 1</xsl:variable>
  +<xsl:variable name="cocoon2-environment">Cocoon 2</xsl:variable>
  +
  +<xsl:variable name="cocoon1-xsp-namespace-uri">http://www.apache.org/1999/XSP/Core</xsl:variable>
  +<xsl:variable name="cocoon2-xsp-namespace-uri">http://apache.org/xsp</xsl:variable>
  +
  +<xsl:variable name="environment">
  +  <xsl:choose>
  +    <xsl:when test="starts-with($XSP-ENVIRONMENT,$cocoon1-environment)">
  +      <xsl:text>cocoon1</xsl:text>
  +    </xsl:when>
  +    <xsl:when test="starts-with($XSP-ENVIRONMENT,$cocoon2-environment)">
  +      <xsl:text>cocoon2</xsl:text>
  +    </xsl:when>
  +    <xsl:otherwise>
  +      <xsl:text>cocoon2</xsl:text>
  +    </xsl:otherwise>
  +  </xsl:choose>
  +</xsl:variable>
  +
  +<xsl:variable name="xsp-namespace-uri">
  +  <xsl:choose>
  +    <xsl:when test="$environment = 'cocoon1'">
  +      <xsl:value-of select="$cocoon1-xsp-namespace-uri"/>
  +    </xsl:when>
  +    <xsl:when test="$environment = 'cocoon2'">
  +      <xsl:value-of select="$cocoon2-xsp-namespace-uri"/>
  +    </xsl:when>
  +  </xsl:choose>
  +</xsl:variable>
  +
  +<xsl:template name="get-nested-content">
  +  <xsl:param name="content"/>
  +  <xsl:choose>
  +    <xsl:when test="$content/*">
  +      <xsl:apply-templates select="$content/*"/>
  +    </xsl:when>
  +    <xsl:otherwise>
  +      <xsl:value-of select="$content"/>
  +    </xsl:otherwise>
  +  </xsl:choose>
  +</xsl:template>
  +
  +<xsl:template name="get-nested-string">
  +  <xsl:param name="content"/>
  +  <xsl:choose>
  +    <xsl:when test="$environment = 'cocoon1'">
  +      <xsl:choose>
  +        <xsl:when test="$content/*">
  +          ""
  +          <xsl:for-each select="$content/node()">
  +            <xsl:choose>
  +              <xsl:when test="name(.)">
  +                + <xsl:apply-templates select="."/>
  +              </xsl:when>
  +              <xsl:otherwise>
  +                + "<xsl:value-of select="translate(.,'&#9;&#10;&#13;','
  ')"/>"
  +              </xsl:otherwise>
  +            </xsl:choose>
  +          </xsl:for-each>
  +        </xsl:when>
  +        <xsl:otherwise>
  +          "<xsl:value-of select="normalize-space($content)"/>"
  +        </xsl:otherwise>
  +      </xsl:choose>
  +    </xsl:when>
  +    <xsl:when test="$environment = 'cocoon2'">
  +      <xsl:choose>
  +        <xsl:when test="$content/*">
  +          ""
  +          <xsl:for-each select="$content/node()">
  +            <xsl:choose>
  +              <xsl:when test="name(.)">
  +                <xsl:choose>
  +                  <xsl:when test="namespace-uri(.)='http://apache.org/xsp' and local-name(.)='text'">
  +                    + "<xsl:value-of select="."/>"
  +                  </xsl:when>
  +                  <xsl:otherwise>
  +                    + <xsl:apply-templates select="."/>
  +                  </xsl:otherwise>
  +                </xsl:choose>
  +              </xsl:when>
  +              <xsl:otherwise>
  +                + "<xsl:value-of select="translate(.,'&#9;&#10;&#13;','
  ')"/>"
  +              </xsl:otherwise>
  +            </xsl:choose>
  +          </xsl:for-each>
  +        </xsl:when>
  +        <xsl:otherwise>"<xsl:value-of select="normalize-space($content)"/>"</xsl:otherwise>
  +      </xsl:choose>
  +    </xsl:when>
  +  </xsl:choose>
  +</xsl:template>
  +
   <xsl:template match="xsp:page">
     <xsl:copy>
       <xsl:apply-templates select="@*"/>
  @@ -121,28 +220,6 @@
     <xsl:copy>
       <xsl:apply-templates select="@*|node()"/>
     </xsl:copy>
  -</xsl:template>
  -
  -<xsl:template name="get-nested-string">
  -  <xsl:param name="content"/>
  -  <xsl:choose>
  -    <xsl:when test="$content/*">
  -      ""
  -      <xsl:for-each select="$content/node()">
  -        <xsl:choose>
  -          <xsl:when test="name(.)"> 
  -            + <xsl:apply-templates select="."/>
  -          </xsl:when>
  -          <xsl:otherwise>
  -            + "<xsl:value-of select="translate(.,'&#9;&#10;&#13;','   ')"/>"
  -          </xsl:otherwise>
  -        </xsl:choose>
  -      </xsl:for-each>
  -    </xsl:when>
  -    <xsl:otherwise>
  -      "<xsl:value-of select="normalize-space($content)"/>"
  -    </xsl:otherwise>
  -  </xsl:choose>
   </xsl:template>
   
   </xsl:stylesheet>
  
  
  

Mime
View raw message