You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Alan Hodgkinson <al...@softxs.ch> on 2002/09/24 15:25:22 UTC

Problem with homemade logicsheet

Dear All,

I'm trying to implement and integrate my own logic sheet and
am having trouble deploying it. I suspect that the problem
is related to the href that defines the buildit-logicsheet
in cocoon.xconf.

When I call the XSP page that causes the error I get the
following stacktrace:

  org.apache.cocoon.ProcessingException: Could not transform 
  jndi:/localhost/tc/logicsheets/lop.xsl:
  org.apache.avalon.excalibur.xml.xslt.XSLTProcessorException: 
  Exception in creating Transform Handler

[More extracts from the files involved are at the end of this
message]

>From cocoon.xconf: Where I suspect there's a problem.

  <target-language name="java">
    <!-- Defines the XSP Core logicsheet for the Java language -->
    <parameter name="core-logicsheet" ...[snip]...

    <builtin-logicsheet>
      <parameter name="prefix" value="lop"/>
      <parameter name="uri"
value="http://softxs.ch/cocoon/logicalOutput"/>
      <parameter name="href" value="context://logicsheets/lop.xsl"/>
    </builtin-logicsheet>
    ...

I've also tried this with 'file://logicsheets/lop.xsl', with the 
lop.xsp in the root directory of the application (and without the 
logicsheets directory name) and a number of other variants. Nothing 
seems to change the error message.

In particular I renamed lop.xsl to bozo.xsl and still got the 
same error, which leads me to suspect that Cocoon isn't even able 
to find my logicsheet, lop.xsl.

I've exhausted all the tips from similar problems that I found in 
the mail archives. 

Perhaps one of you gurus could help.

My environment is:
- CVS head (as of 11-Sep-2002)
- Toomcat 4.0.1
- JDK 1.3.0rc1-b17.

Many thanks in advance and best wishes,

Alan.


Relevant file extracts follow:
------------------------------

The xsp page: lop-select.xsp

  <xsp:page
    language="java"
    xmlns:xsp="http://apache.org/xsp"
    xmlns:esql="http://apache.org/cocoon/SQL/v2"
    xmlns:lop="http://softxs.ch/cocoon/logicalOutput"
  >
  <select>
    <lop:db-option-list
        connection="timetracker"
        table="Projects"
        value-field="projectId"
        text-field="name"/>
  </select>
  </xsp:page>

The logicsheet: lop.xsl

  <!-- $Id$ -->
  <xsp:styesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:xsp="http://apache.org/xsp"
    xmlns:esql="http://apache.org/cocoon/SQL/v2"
    xmlns:lop="http://softxs.ch/cocoon/logicalOutput">
 
  <!-- Copy everything that doesn't get matched below -->

  <xsl:template match="@*|node()">
    <xsl:copy>
      <xsl:apply-templates select="@*|node()"/>
    </xsl:copy>
  </xsl:template>

  <!-- 
    Insert lame content, to test deployment and
    eliminate possible logicsheet XSLT errors
   -->

  <xsl:template match="lop:db-option-list">
    <got-it/>
  </xsl:template>
  
  </xsl:stylesheet>


>From sitemap.xmsp: The request used to test is: 'select-lop.html'

  <map:match pattern="*-select.html">
    <map:generate type="serverpages" src="xsp/{1}-select.xsp"/>
    <map:serialize type="xml"/>
  </map:match>

--end--

---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: Problem with homemade logicsheet

Posted by Vadim Gritsenko <va...@verizon.net>.
Alan Hodgkinson wrote:

>>Jeff Turner wrote:
>>
>>Alan Hodgkinson wrote:
>>...
>>    
>>
>>>  <xsp:styesheet version="1.0"
>>>      
>>>
>>     ^^^
>>    
>>
>              ^
>              |
>Arrrghhhh!    +-->  'styesheet' != 'stylesheet'
>
>That solved part of the problem. As you pointed out, I also 
>had 'xsp' instead of 'xsl'. It came from copying an XSP 
>page in order to get the correct namespaces. Oops! 
>
>Jeff: many thanks for you help!
>
>..but unfortunately it doesn't solve the entire problem.
>
>That is, I cannot make the technique described in Matthew and 
>Carston's book (and the Cocoon web site) work where you use 
>the 'context:' protocol to define the location of xsl file. 
>
>  <builtin-logicsheet>
>    <parameter name="prefix" value="lop"/>
>    <parameter name="uri"
>value="http://softxs.ch/cocoon/logicalOutput/1.0"/>
>    <parameter name="href" value="context://logicsheets/lop.xsl"/>
>  </builtin-logicsheet>
>
>I've tried the following variations in cocoon.xconf for the 
>logicsheet href. All of them fail:
>
>  context://lop.xsl
>  context://logicsheets/lop.xsl
>  file:///lop.xsl
>  file:///logicsheets/lop.xsl
>
>..they all cause a resource not found error in the logs.
>
>As a last resort I tried:
>
>  logicsheets/lop.xsl
>
>E.g. with no protocol in the href. This appears to work, but 
>don't ask me why! For now it's an acceptible work-around, but it 
>definitely does not seem to be working as documented. Strange.
>
>Note that I can also make the logic sheet work if I configure my 
>cocoon.xconf as follows:
>
>  <builtin-logicsheet>
>    <parameter name="prefix" value="lop"/>
>    <parameter name="uri"
>value="http://softxs.ch/cocoon/logicalOutput/1.0"/>
>    <parameter name="href" value="resource://ch/softxs/cocoon/lop.xsl"/>
>  </builtin-logicsheet>
>
>but this requires me to create a jar file with the appropriate
>structure that I place in WEB-INF/lib. And then you have to bounce
>Tomcat, makeing the developement cycle much slower.
>
>I'd appreciate any feedback on the way the href in cocoon.xconf
>is supposed to function.
>

Is this the same bug?
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=10473

Vadim


>Best wishes,
>
>Alan.
>  
>




---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: Problem with homemade logicsheet

Posted by Alan Hodgkinson <al...@softxs.ch>.
> Jeff Turner wrote:
> 
> Alan Hodgkinson wrote:
> ...
> >   <xsp:styesheet version="1.0"
>      ^^^
              ^
              |
Arrrghhhh!    +-->  'styesheet' != 'stylesheet'

That solved part of the problem. As you pointed out, I also 
had 'xsp' instead of 'xsl'. It came from copying an XSP 
page in order to get the correct namespaces. Oops! 

Jeff: many thanks for you help!

..but unfortunately it doesn't solve the entire problem.

That is, I cannot make the technique described in Matthew and 
Carston's book (and the Cocoon web site) work where you use 
the 'context:' protocol to define the location of xsl file. 

  <builtin-logicsheet>
    <parameter name="prefix" value="lop"/>
    <parameter name="uri"
value="http://softxs.ch/cocoon/logicalOutput/1.0"/>
    <parameter name="href" value="context://logicsheets/lop.xsl"/>
  </builtin-logicsheet>

I've tried the following variations in cocoon.xconf for the 
logicsheet href. All of them fail:

  context://lop.xsl
  context://logicsheets/lop.xsl
  file:///lop.xsl
  file:///logicsheets/lop.xsl

..they all cause a resource not found error in the logs.

As a last resort I tried:

  logicsheets/lop.xsl

E.g. with no protocol in the href. This appears to work, but 
don't ask me why! For now it's an acceptible work-around, but it 
definitely does not seem to be working as documented. Strange.

Note that I can also make the logic sheet work if I configure my 
cocoon.xconf as follows:

  <builtin-logicsheet>
    <parameter name="prefix" value="lop"/>
    <parameter name="uri"
value="http://softxs.ch/cocoon/logicalOutput/1.0"/>
    <parameter name="href" value="resource://ch/softxs/cocoon/lop.xsl"/>
  </builtin-logicsheet>

but this requires me to create a jar file with the appropriate
structure that I place in WEB-INF/lib. And then you have to bounce
Tomcat, makeing the developement cycle much slower.

I'd appreciate any feedback on the way the href in cocoon.xconf
is supposed to function.

Best wishes,

Alan.

---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: Problem with homemade logicsheet

Posted by Jeff Turner <je...@apache.org>.
On Tue, Sep 24, 2002 at 01:25:22PM +0000, Alan Hodgkinson wrote:
...
>   <xsp:styesheet version="1.0"
     ^^^

Probably just a typo in the email, but make sure that the real thing has
'xsl', not 'xsp'. I've made that mistake a few times ;P

--Jeff

...

---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>


Re: Problem with homemade logicsheet --> bug or config error?

Posted by Alan Hodgkinson <al...@softxs.ch>.
Alan Hodgkinson wrote:

> I'm trying to implement and integrate my own logic sheet and
> am having trouble deploying it. I suspect that the problem
> is related to the href that defines the buildit-logicsheet
> in cocoon.xconf.
<snip/>
> I've exhausted all the tips from similar problems that I found in
> the mail archives.

And noticed a recent, similar mail where it mentions that logicsheets 
have 'stopped working'. 

http://www.mail-archive.com/cocoon-users@xml.apache.org/msg18252.html

Could this be related?

> Perhaps one of you gurus could help.

Yup.. definitely gonna need a guru. Even if it's just to find the 
dumb mistake that _I_ made.
 
> My environment is:
> - CVS head (as of 11-Sep-2002)

I updated to the latest CVS head. (Logging seems slightly better, 
thanks!)

> - Toomcat 4.0.1
> - JDK 1.3.0rc1-b17.

I have been trying again to solve this by creating a jar file and
referencing it using "resouce://ch/softxs/cocoon/lop.xsl" in 
cocoon.xconf. I then placed the jar file in WEB-INF/lib in my
application directory ( $TOMCAT_HOME/webapps/tc ). Is that what 
we're supposed to do?

In any case, it didn't work either. But now it reports errors
corresponding to what is in the lop.xsl file, which means that
the cocoon.xconf is at least functioning (though it quite 
irritating that the context: and file: protocols don't work as
documented, because I have to restart cocoon after every change)

I notice in the logs the following error:

  ERROR   (2002-09-24) 19:48.44:261   [core.xslt-processor]
(/test/lop-select.html)   
  HttpProcessor[8080][4]/TraxErrorHandler: Error in TraxTransformer:   
  resource://ch/softxs/cocoon/lop.xsl; Line 7; Column 59; 
  ; SystemID: resource://ch/softxs/cocoon/lop.xsl; Line#: 7; Column#: 59
  javax.xml.transform.TransformerException: stylesheet requires
attribute: 
  version

Which I presume is refering to initial tag <xsl:stylesheet>. Well, I do
have a version="1.0" in that tag. See below..

> 
> Relevant file extracts follow:
> ------------------------------
> 
> The xsp page: lop-select.xsp
> 
>   <xsp:page
>     language="java"
>     xmlns:xsp="http://apache.org/xsp"
>     xmlns:esql="http://apache.org/cocoon/SQL/v2"
>     xmlns:lop="http://softxs.ch/cocoon/logicalOutput"
>   >
>   <select>
>     <lop:db-option-list
>         connection="timetracker"
>         table="Projects"
>         value-field="projectId"
>         text-field="name"/>
>   </select>
>   </xsp:page>
> 
> The logicsheet: lop.xsl
> 
>   <!-- $Id$ -->
Added the following line: (is it required at the start of XSP and XSL
files?)

    <?xml version="1.0" encoding="ISO-8859-1"?>

>   <xsp:styesheet version="1.0"
>     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>     xmlns:xsp="http://apache.org/xsp"
>     xmlns:esql="http://apache.org/cocoon/SQL/v2"
>     xmlns:lop="http://softxs.ch/cocoon/logicalOutput">
> 
>   <!-- Copy everything that doesn't get matched below -->
> 
>   <xsl:template match="@*|node()">
>     <xsl:copy>
>       <xsl:apply-templates select="@*|node()"/>
>     </xsl:copy>
>   </xsl:template>
> 
>   <!--
>     Insert lame content, to test deployment and
>     eliminate possible logicsheet XSLT errors
>    -->
> 
>   <xsl:template match="lop:db-option-list">
>     <got-it/>
>   </xsl:template>
> 
>   </xsl:stylesheet>
> 
> >From sitemap.xmsp: The request used to test is: 'select-lop.html'
> 
>   <map:match pattern="*-select.html">
>     <map:generate type="serverpages" src="xsp/{1}-select.xsp"/>
>     <map:serialize type="xml"/>
>   </map:match>

---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <co...@xml.apache.org>
For additional commands, e-mail:   <co...@xml.apache.org>