You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Jo Bourne <ve...@va.com.au> on 2001/10/16 04:37:47 UTC

[c2] possible util logicsheet bug

Hi,

I am trying to upgrade our c1.8.2 sites to c2 and I think I have found a bug in the util logic sheet, I am trying to include an remote xml page using xsp. first i tried using pages from one of our c1.8.2 that worked fine before upgrading (I did change the xsp namespace declarations) and when this failed I have pruned back and back until all I have is this:

<?xml version="1.0" ?>
<xsp:page language="java" xmlns:xsp="http://apache.org/xsp"
              xmlns:util="http://apache.org/xsp/util/2.0">
 <page>
  <xsp:logic>
   <util:include-uri>
    <util:href>http://alice.va.com.au:8080/cocoon/afringe/login</util:href>
   </util:include-uri>	
  </xsp:logic>
 </page>
</xsp:page>

the page i am trying to include (login) is a simple xml file and is loading fine if i access it directly.

the error i am getting is :

Error creating the resource
Language Exception 
org.apache.cocoon.ProcessingException: Language Exception: org.apache.cocoon.components.language.LanguageException: Error compiling login2_xml: Line 97, column 104: ')' expected.

the .java file generated is below, and attached. From looking at the logicsheet I think that the get-nested-content is causing the line produced by include-uri to end in "););" which I believe is illegal?

I would be very grateful if you could confirm if this is a bug or not, I am not on the dev list so if you could cc me on your emails that would be great,

we are using c2rc1a on tomcat 4b8, on freeBSD

thanks in advance
Jo




package org.apache.cocoon.www.file_.usr.local.jakarta_tomcat_4_0.webapps.cocoon.afringe;

import java.io.File;
import java.io.IOException;
import java.io.StringReader;
//import java.net.*;
import java.util.Date;
import java.util.List;
import java.util.Stack;

//import org.w3c.dom.*;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import org.xml.sax.helpers.AttributesImpl;

//import org.apache.avalon.framework.*;
import org.apache.avalon.framework.component.Component;
import org.apache.avalon.framework.component.ComponentException;
import org.apache.avalon.framework.component.ComponentManager;
import org.apache.avalon.framework.component.ComponentSelector;
import org.apache.avalon.framework.context.Context;
import org.apache.avalon.excalibur.datasource.DataSourceComponent;
//import org.apache.avalon.framework.util.*;

import org.apache.cocoon.Constants;
import org.apache.cocoon.ProcessingException;
import org.apache.cocoon.components.parser.Parser;
import org.apache.cocoon.generation.Generator;
//import org.apache.cocoon.util.*;

import org.apache.cocoon.components.language.markup.xsp.XSPGenerator;
import org.apache.cocoon.components.language.markup.xsp.XSPObjectHelper;
import org.apache.cocoon.components.language.markup.xsp.XSPRequestHelper;
import org.apache.cocoon.components.language.markup.xsp.XSPResponseHelper;


/* User Imports */

import java.net.URL;

import java.util.Date;

import java.io.FileReader;

import java.text.SimpleDateFormat;

import org.apache.cocoon.components.language.markup.xsp.XSPUtil;


/**
 * Generated by XSP. Edit at your own risk, :-)
 */
public class login2_xml extends XSPGenerator {

  static {
    dateCreated = 1003160157377L;
    dependencies = new File[]{
                   };
  }

  /* Built-in parameters available for use */
  // context    - ServletContext
  // request    - HttpServletRequest
  // response   - HttpServletResponse
  // parameters - parameters defined in the sitemap

  /* User Class Declarations */


  /**
  * Generate XML data.
  */
  public void generate() throws SAXException, IOException,
  ProcessingException {



    this.contentHandler.startDocument();
    AttributesImpl xspAttr = new AttributesImpl();



    this.contentHandler.startPrefixMapping("util", "http://apache.org/xsp/util/2.0");

    this.contentHandler.startPrefixMapping("xsp", "http://apache.org/xsp");


    this.contentHandler.startElement("", "page", "page", xspAttr);

    xspAttr.clear();


    this.characters("\n\t\t\t");
    {
      String __name = String.valueOf(this.characters("http://alice.va.com.au:8080/cocoon/afringe/login"););
      {
        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);
                    } }
    }
    this.characters("\t\n    ");


    this.contentHandler.endElement("", "page", "page");


    this.contentHandler.endPrefixMapping("util");

    this.contentHandler.endPrefixMapping("xsp");


    this.contentHandler.endDocument();
  }
}



---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: [c2] possible util logicsheet bug

Posted by Martin Man <Ma...@seznam.cz>.
On Tue, Oct 16, 2001 at 12:37:47PM +1000, Jo Bourne wrote:
> Hi,
> 
> I am trying to upgrade our c1.8.2 sites to c2 and I think I have found a bug in the util logic sheet, I am trying to include an remote xml page using xsp. first i tried using pages from one of our c1.8.2 that worked fine before upgrading (I did change the xsp namespace declarations) and when this failed I have pruned back and back until all I have is this:
> 
> <?xml version="1.0" ?>
> <xsp:page language="java" xmlns:xsp="http://apache.org/xsp"
>               xmlns:util="http://apache.org/xsp/util/2.0">
>  <page>
>   <xsp:logic>
>    <util:include-uri>
>     <util:href>http://alice.va.com.au:8080/cocoon/afringe/login</util:href>
>    </util:include-uri>	
>   </xsp:logic>
>  </page>
> </xsp:page>

yep, it's a bug, I'm able to reproduce it with cocoon, however not using
standalone application of util.xsl and xsp.xsl onto your page...

I'm going into it now and will let you know later on what's the result...

> 
> <xnip/>
> 

-- 
2CC0 4AF6 92DA 5CBF 5F09  7BCB 6202 7024 6E06 0223

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org