You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by ha...@apache.org on 2002/07/14 17:07:31 UTC

cvs commit: xml-cocoon2/src/java/org/apache/cocoon/components/language/markup/xsp/java logicsheet-util.xsl util.xsl

haul        2002/07/14 08:07:31

  Modified:    src/java/org/apache/cocoon/components/language/markup/xsp/java
                        Tag: cocoon_2_0_3_branch logicsheet-util.xsl
                        util.xsl
  Log:
  backport fix util.xsl
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.4.2.1   +12 -2     xml-cocoon2/src/java/org/apache/cocoon/components/language/markup/xsp/java/logicsheet-util.xsl
  
  Index: logicsheet-util.xsl
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/language/markup/xsp/java/logicsheet-util.xsl,v
  retrieving revision 1.4
  retrieving revision 1.4.2.1
  diff -u -r1.4 -r1.4.2.1
  --- logicsheet-util.xsl	27 Feb 2002 05:26:41 -0000	1.4
  +++ logicsheet-util.xsl	14 Jul 2002 15:07:31 -0000	1.4.2.1
  @@ -149,6 +149,11 @@
       <xsl:param name="default"/>
       <xsl:param name="required">false</xsl:param>
   
  +    <!-- for some unknown reason this needs to be called every time,
  +         otherwise only the first invocation uses a correct namespace
  +         prefix. -->
  +    <xsl:variable name="namespace-prefix"><xsl:call-template name="get-namespace-prefix"/></xsl:variable>
  +
       <xsl:variable name="qname">
         <xsl:value-of select="concat($namespace-prefix, ':param')"/>
       </xsl:variable>
  @@ -223,6 +228,11 @@
       <xsl:param name="name"/>
       <xsl:param name="default"/>
       <xsl:param name="required">false</xsl:param>
  +
  +    <!-- for some unknown reason this needs to be called every time,
  +         otherwise only the first invocation uses a correct namespace
  +         prefix. -->
  +    <xsl:variable name="namespace-prefix"><xsl:call-template name="get-namespace-prefix"/></xsl:variable>
   
       <xsl:variable name="qname">
         <xsl:value-of select="concat($namespace-prefix, ':param')"/>
  
  
  
  1.4.2.1   +41 -83    xml-cocoon2/src/java/org/apache/cocoon/components/language/markup/xsp/java/util.xsl
  
  Index: util.xsl
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/language/markup/xsp/java/util.xsl,v
  retrieving revision 1.4
  retrieving revision 1.4.2.1
  diff -u -r1.4 -r1.4.2.1
  --- util.xsl	21 Feb 2002 03:36:09 -0000	1.4
  +++ util.xsl	14 Jul 2002 15:07:31 -0000	1.4.2.1
  @@ -65,6 +65,9 @@
     xmlns:xsp="http://apache.org/xsp"
     xmlns:util="http://apache.org/xsp/util/2.0"
   >
  +  <xsl:variable name="namespace-uri">http://apache.org/xsp/util/2.0</xsl:variable>
  +  <xsl:include href="logicsheet-util.xsl"/>
  +
     <xsl:template match="xsp:page">
       <xsp:page>
         <xsl:apply-templates select="@*"/>
  @@ -123,6 +126,36 @@
     </xsl:template>
     -->
   
  +  <xsl:template match="util:get-source">
  +    <xsl:variable name="source-uri">
  +      <xsl:call-template name="get-string-parameter">
  +        <xsl:with-param name="name">uri</xsl:with-param>
  +      </xsl:call-template>
  +    </xsl:variable>
  +    <xsp:expr>
  +      XSPUtil.getSourceAsString(<xsl:copy-of select="$source-uri"/>,this.resolver)
  +    </xsp:expr>
  +  </xsl:template>
  +
  +  <xsl:template match="util:include-source">
  +    <xsl:variable name="source-uri">
  +      <xsl:call-template name="get-string-parameter">
  +        <xsl:with-param name="name">uri</xsl:with-param>
  +      </xsl:call-template>
  +    </xsl:variable>
  +    <xsl:variable name="source-base">
  +      <xsl:call-template name="get-string-parameter">
  +        <xsl:with-param name="name">base</xsl:with-param>
  +      </xsl:call-template>
  +    </xsl:variable>
  +    <xsp:logic>
  +      XSPUtil.includeSource(<xsl:copy-of select="$source-uri"/>, <xsl:copy-of select="$source-base"/>, this.resolver, this.contentHandler);
  +    </xsp:logic>
  +  </xsl:template>
  +
  +
  +
  +
     <!-- Include URL contents as SAX -->
     <xsl:template match="util:include-uri">
       <xsl:variable name="href">
  @@ -135,31 +168,12 @@
           </xsl:when>
         </xsl:choose>
       </xsl:variable>
  -
  -    <xsp:logic> {
  -      String __name = String.valueOf(<xsl:copy-of select="$href"/>);
  -      {
  -          org.apache.cocoon.components.parser.Parser newParser = null;
  -          org.apache.cocoon.components.url.URLFactory factory = null;
  -
  -          try {
  -              newParser = (org.apache.cocoon.components.parser.Parser) this.manager.lookup(org.apache.cocoon.components.parser.Parser.ROLE);
  -              factory = (org.apache.cocoon.components.url.URLFactory) this.manager.lookup(org.apache.cocoon.components.url.URLFactory.ROLE);
  -              URL __url = factory.getURL(__name);
  -              InputSource __is = new InputSource(__url.openStream());
  -              __is.setSystemId(__url.toString());
  -
  -              XSPUtil.include(__is, this.contentHandler, newParser);
  -          } catch (Exception e) {
  -              getLogger().error("Could not include page", e);
  -          } finally {
  -              if (factory != null) this.manager.release((Component) factory);
  -              if (newParser != null) this.manager.release((Component) newParser);
  -          }
  -      }
  -    } </xsp:logic>
  +    <xsp:logic>
  +      XSPUtil.includeSource(<xsl:copy-of select="$href"/>, null, this.resolver, this.contentHandler);
  +    </xsp:logic>
     </xsl:template>
   
  +
      <!-- Include file contents as SAX -->
      <xsl:template match="util:include-file">
        <xsl:variable name="name">
  @@ -173,28 +187,7 @@
          </xsl:choose>
        </xsl:variable>
        <xsp:logic>
  -       {
  -          org.apache.cocoon.components.parser.Parser newParser = null;
  -
  -          try {
  -              newParser = (org.apache.cocoon.components.parser.Parser) this.manager.lookup(org.apache.cocoon.components.parser.Parser.ROLE);
  -              InputSource __is = new InputSource(
  -                      new FileReader(
  -                         XSPUtil.relativeFilename(
  -                           <xsl:copy-of select="$name"/>,
  -                           objectModel
  -                        )
  -                      )
  -                  );
  -
  -
  -              XSPUtil.include(__is, this.contentHandler, newParser);
  -            } catch (Exception e) {
  -              getLogger().error("Could not include page", e);
  -            } finally {
  -              if (newParser != null) this.manager.release((Component) newParser);
  -            }
  -       }
  +       XSPUtil.includeFile(<xsl:copy-of select="$name"/>,this.manager, this.contentHandler, objectModel);
        </xsp:logic>
      </xsl:template>
   
  @@ -210,25 +203,7 @@
       </xsl:variable>
   
       <xsp:logic>
  -      {
  -          org.apache.cocoon.components.parser.Parser newParser = null;
  -
  -          try {
  -              newParser = (org.apache.cocoon.components.parser.Parser) this.manager.lookup(org.apache.cocoon.components.parser.Parser.ROLE);
  -              InputSource __is = new InputSource(
  -                      new StringReader(
  -                          String.valueOf(<xsl:copy-of select="$expr"/>)
  -                      )
  -                  );
  -
  -
  -              XSPUtil.include(__is, this.contentHandler, newParser);
  -          } catch (Exception e) {
  -              getLogger().error("Could not include page", e);
  -          } finally {
  -              if (newParser != null) this.manager.release((Component) newParser);
  -          }
  -      }
  +      XSPUtil.includeString(<xsl:copy-of select="$expr"/>,this.manager, this.contentHandler);
       </xsp:logic>
     </xsl:template>
   
  @@ -302,22 +277,5 @@
       </xsp:expr>
     </xsl:template>
   
  -  <!-- Standard Templates -->
  -  <xsl:template name="get-nested-content">
  -    <xsl:param name="content"/>
  -    <xsl:choose>
  -      <xsl:when test="$content/xsp:text">"<xsl:value-of select="$content"/>"</xsl:when>
  -      <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 match="@*|*|text()|processing-instruction()">
  -    <xsl:copy>
  -      <xsl:apply-templates select="@*|*|text()|processing-instruction()"/>
  -    </xsl:copy>
  -  </xsl:template>
   
   </xsl:stylesheet>
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org


Re: cvs commit: xml-cocoon2/src/java/org/apache/cocoon/components/language/markup/xsp/java logicsheet-util.xsl util.xsl

Posted by Christian Haul <ha...@informatik.tu-darmstadt.de>.
Vadim Gritsenko wrote:
> Sorry, mozilla crash marked it as unread :)))

Though it must be something like that 8-D

	Chris.

-- 
C h r i s t i a n       H a u l
haul@informatik.tu-darmstadt.de
     fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08


Re: cvs commit: xml-cocoon2/src/java/org/apache/cocoon/components/language/markup/xsp/java logicsheet-util.xsl util.xsl

Posted by Vadim Gritsenko <va...@verizon.net>.
Christian Haul wrote:

> Vadim Gritsenko wrote:
>
>> haul@apache.org wrote:
>>
>>> haul        2002/07/14 08:07:31
>>
>
>> Backport to where? If you want to backport fix to 2.0.5-dev (my guess),
>> then you should patch cocoon-2.0 CVS HEAD.
>>
>> PS Why cocoon-2 CVS is allowed to be modified? I guess we decided to
>> make it read-only?
>
>
> Vadim, could you give a little more detail. This commit message is 15 
> months old.....


:-O

Sorry, mozilla crash marked it as unread :)))

Vadim



Re: cvs commit: xml-cocoon2/src/java/org/apache/cocoon/components/language/markup/xsp/java logicsheet-util.xsl util.xsl

Posted by Antonio Gallardo <ag...@agsoftware.dnsalias.com>.
Christian Haul dijo:
> Vadim Gritsenko wrote:
>> haul@apache.org wrote:
>>
>>> haul        2002/07/14 08:07:31
>
>> Backport to where? If you want to backport fix to 2.0.5-dev (my
>> guess), then you should patch cocoon-2.0 CVS HEAD.
>>
>> PS Why cocoon-2 CVS is allowed to be modified? I guess we decided to
>> make it read-only?
>
> Vadim, could you give a little more detail. This commit message is 15
> months old.....

8-0

Antonio Gallardo




Re: cvs commit: xml-cocoon2/src/java/org/apache/cocoon/components/language/markup/xsp/java logicsheet-util.xsl util.xsl

Posted by Christian Haul <ha...@informatik.tu-darmstadt.de>.
Vadim Gritsenko wrote:
> haul@apache.org wrote:
> 
>> haul        2002/07/14 08:07:31

> Backport to where? If you want to backport fix to 2.0.5-dev (my guess),
> then you should patch cocoon-2.0 CVS HEAD.
> 
> PS Why cocoon-2 CVS is allowed to be modified? I guess we decided to
> make it read-only?

Vadim, could you give a little more detail. This commit message is 15 
months old.....

	Chris.

-- 
C h r i s t i a n       H a u l
haul@informatik.tu-darmstadt.de
     fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08


Re: cvs commit: xml-cocoon2/src/java/org/apache/cocoon/components/language/markup/xsp/java logicsheet-util.xsl util.xsl

Posted by Vadim Gritsenko <va...@verizon.net>.
haul@apache.org wrote:

>haul        2002/07/14 08:07:31
>
>  Modified:    src/java/org/apache/cocoon/components/language/markup/xsp/java
>                        Tag: cocoon_2_0_3_branch logicsheet-util.xsl
>                        util.xsl
>  Log:
>  backport fix util.xsl
>

Backport to where? If you want to backport fix to 2.0.5-dev (my guess),
then you should patch cocoon-2.0 CVS HEAD.

PS Why cocoon-2 CVS is allowed to be modified? I guess we decided to
make it read-only?

Vadim