cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Sharpe <p...@miraclefish.com>
Subject Cocoon hangs with chained XSP
Date Mon, 19 Jun 2000 12:23:29 GMT
I'm trying to use this processing sequence

  XSP-->XSL-->XSP-->XSL

However cocoon seems to hang when the second XSP PI is present.

Help! :(

paul

-8<--

<!-- foo.xml -->
<?xml version="1.0"?> 
<?cocoon-process type="xsp"?>
<?cocoon-process type="xslt"?>

<xsp:page xmlns:xsp="http://www.apache.org/1999/XSP/Core"
          xmlns:request="http://www.apache.org/1999/XSP/Request"
          xmlns:util="http://www.apache.org/1999/XSP/Util">

  <xsp:logic>
    String ROOT = "/tmp/";
    private static boolean exists(String filepath) {
      File file = new File(filepath);
      return file.exists();
    }
  </xsp:logic>
  <page>
  <xsp:pi target="xml-stylesheet">
    href="foo-xsp.xsl"
    type="text/xsl"
  </xsp:pi>

  <content>
    <xsp:logic>
      String file = request.getParameter("file");
      String filepath = ROOT + file + ".xml";
      if ( exists(filepath) ) {
      <xsp:content>
        <report><xsp:expr>report</xsp:expr></report>
        <util:include-file>
          <util:name><xsp:expr>filepath</xsp:expr></util:name>
        </util:include-file>
      </xsp:content>
      }
    </xsp:logic>
  </content>
  </page>
</xsp:page>


<!-- foo-xsp.xsl -->
<?xml version="1.0"?> 
<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:xsp="http://www.apache.org/1999/XSP/Core">

  <xsl:template match="/">
<!-- cocoon doesn't hang if the following line is commented out -->
    <xsl:processing-instruction name="cocoon-process">type="xsp"</xsl:processing-instruction>
    <xsl:processing-instruction name="cocoon-process">type="xslt"</xsl:processing-instruction>
    <xsl:processing-instruction name="xml-stylesheet">href="foo-html.xsl" type="text/xsl"</xsl:processing-instruction>
    <xsl:apply-templates/>
  </xsl:template>

<xsl:template match="page">
    <xsp:page>
      <page>
<!-- and soforth... -->

--
paul@miraclefish.com



Mime
View raw message