cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rica...@locus.apache.org
Subject cvs commit: xml-cocoon/src/org/apache/cocoon/processor/xsp/library/java util.xsl
Date Tue, 09 May 2000 18:19:45 GMT
ricardo     00/05/09 11:19:43

  Modified:    src/org/apache/cocoon/processor/xsp/library/java util.xsl
  Log:
  Fixed omission of <util:include-file>
  
  Revision  Changes    Path
  1.15      +29 -37    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.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- util.xsl	2000/05/07 02:31:15	1.14
  +++ util.xsl	2000/05/09 18:19:41	1.15
  @@ -110,43 +110,35 @@
       } </xsp:logic>
     </xsl:template>
   
  -  <!-- Include URL contents as DOM -->
  -  <xsl:template match="util:include-uri">
  -    <xsl:variable name="href">
  -      <xsl:choose>
  -        <xsl:when test="@href">"<xsl:value-of select="@href"/>"</xsl:when>
  -        <xsl:when test="util:href">
  -          <xsl:call-template name="get-nested-content">
  -            <xsl:with-param name="content" select="util:href"/>
  -          </xsl:call-template>
  -        </xsl:when>
  -      </xsl:choose>
  -    </xsl:variable>
  -
  -    <!-- This should be an <xsp:expr> yielding Node... -->
  -    <xsp:logic> {
  -      String __name = String.valueOf(<xsl:copy-of select="$href"/>);
  -
  -      try {
  -        URL __url = new URL(__name);
  -        InputSource __is = new InputSource(__url.openStream());
  -        __is.setSystemId(__url.toString());
  -
  -        xspCurrentNode.appendChild(
  -          XSPUtil.cloneNode(
  -            this.xspParser.parse(__is).getDocumentElement(),
  -            document
  -          )
  -        );
  -      } catch (Exception e) {
  -        xspCurrentNode.appendChild(
  -          document.createTextNode(
  -            "{" + __name + "}"
  -          )
  -        );
  -      }
  -    } </xsp:logic>
  -  </xsl:template>
  +   <!-- Include file contents as DOM -->
  +   <xsl:template match="util:include-file">
  +     <xsl:variable name="name">
  +       <xsl:choose>
  +         <xsl:when test="@name">"<xsl:value-of select="@name"/>"</xsl:when>
  +         <xsl:when test="util:name">
  +           <xsl:call-template name="get-nested-content">
  +             <xsl:with-param name="content" select="util:name"/>
  +           </xsl:call-template>
  +         </xsl:when>
  +       </xsl:choose>
  +     </xsl:variable>
  +     <xsp:logic>
  +       xspCurrentNode.appendChild(
  +         XSPUtil.cloneNode(
  +           this.xspParser.parse(
  +             new InputSource(
  +               new FileReader(
  +                 XSPUtil.relativeFilename(
  +                   <xsl:copy-of select="$name"/>,
  +                   request
  +                 )
  +            )
  +           ).getDocumentElement(),
  +           document
  +         )
  +       );
  +     </xsp:logic>
  +   </xsl:template>
   
     <!-- Include expression as DOM -->
     <xsl:template match="util:include-expr">
  
  
  

Mime
View raw message