cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rick <fewa...@facstaff.wisc.edu>
Subject help, please: my 2.0 logicsheets stopped working with 2.0.2
Date Tue, 24 Sep 2002 16:25:30 GMT
hello all,

cocoon allows us to divide labor, as designed. content people get the
source XML file, style people work with the XSL file, and we programmers
hack on XSP.

in order to ensure that the content people didn't have to wade through
(and replicate!) XSP code in each of their pages, we'd adapted an
example from the 2.0 documentation, allowing them to insert a single tag
instead of all the code. with the examples in 2.0.3, it looks like the
"logicsheet" idea has been turned around, or else i understood it
backwards in the first place! the logicsheet example in 2.0 showed an
XSL applied which "inserted" logic, which is exactly what we want.

in any case, the following used to work, and no longer does. i included
all the processing-instruction and namespace headers just in case that's
the problem; most of the logicsheet and other content has been elided,
of course!

==== the content providers work on documents looking like this =====

<?xml version="1.0"?>
<!-- $Revision: 1.7 $ -->
<xsp:page 
 xmlns:xsp="http://apache.org/xsp"
 xmlns:emsXSP="http://www.soils.wisc.edu/asig/ems/XSP"
 xmlns:ems="http://www.soils.wisc.edu/asig/"
 xmlns:xsp-request="http://apache.org/xsp/request/2.0" 
 xmlns:session="http://apache.org/xsp/session/2.0"
create-session="true">

 <ems:Worksheet id="WiBarnMgt01" action="BarnMgt.xml">

  <!-- boilerplate XSP stuff -->
  <emsXSP:header-info/>
  <emsXSP:groupParam/>
  <emsXSP:scoringMode/>

  <!-- Now go on with real live content -->
  <ems:Title supertitle="" subtitle="Environmental Management Systems"> 
   Barnyard and Feedlot Management 
  </ems:Title>

  [etc., etc.]
 </ems:Worksheet>
</xsp:page>

============ cocoon.xconf contained: ================

<builtin-logicsheet>
  <parameter name="prefix" value="emsXSP"/>
  <parameter name="uri" value="http://www.soils.wisc.edu/asig/ems/XSP"/>
  <parameter name="href" value="resource://ems/logicsheet/ems.xsp.xsl"/>
</builtin-logicsheet>

============ ems.xsp.xsl contains templates, e.g.: ===================

<?xml version="1.0"?>
<!-- $Revision: 1.1 $ -->
<xsl:stylesheet
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:xsp="http://apache.org/xsp"
  xmlns:ems="http://www.soils.wisc.edu/asig/"
  xmlns:emsXSP="http://www.soils.wisc.edu/asig/ems/XSP"
  xmlns:xsp-request="http://apache.org/xsp/request/2.0"
  xmlns:session="http://apache.org/xsp/session/2.0"
  create-session="true"
  version="1.0">

<xsl:template match="emsXSP:header-info">
  <xsp:logic>
    /* several things break if we have more than 9 risk levels,
     */
    int MAX_RISK_LEVELS = 9;
    int MIN_RISK_LEVEL  = 1;
    /** StringBuffer in which to build query */
    StringBuffer query = new StringBuffer("");
    /** Vector of queries */
    java.util.Vector queries = new java.util.Vector();
    [yada, yada, yada]
  </xsp:logic>
</xsl:template>
[other templates go here]
</xsl:stylesheet>

=============== finally, the sitemap entry ========================

<map:match pattern="ems/*.xml">
 <map:generate type="serverpages" src="ems/docs/{1}.xml"/>
 <map:transform type="xslt" src="ems/stylesheets/worksheet2html.xsl"/> 
 <map:serialize/>
</map:match>


i see no errors cropping up anywhere; it's as if the stylesheet
ems.xsp.xsl is no longer applied to the document, so that none of the
XSP logic fires. i have to admit i never really understood how cocoon
"knew" to apply that logicsheet (unless it has to do with the "prefix"
thing in cocoon.xconf).

??? help ???

rw
-- 
systems programmer
ASIG, univ. of WI soil sciences
http://www.soils.wisc.edu/asig/
608-265-9354, fax 265-2595, cell 345-5247

"Otherwise, it's going to get plenty stupider." -- Jan Koloen

Mime
View raw message