cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kjell.myksv...@telenor.com (Kjell M. Myksvoll)
Subject Re: Order of execution of different namespace tags when using xsp?
Date Thu, 13 Jul 2000 11:31:07 GMT
* Donald Ball
> what you want to do in your logicsheet is something like this:

Thanks for your reply! It gave a very informative description of how I
can solve an another problem that I've had with applying xsp. The
problem that I described in my previous mail is still there though...

Some more description:

 Using an explicit value works

   <ls:set-terminal-id>935235235</ls:set-terminal-id>

 The 935235235 value above are captured fine by the following
 xsl statement

 <xsl:template match="ls:set-terminal-id">
  <xsp:expr>_set_terminal_id("<xsl:value-of select="." />")</xsp:expr>
 </xsl:template>

 But when using the following

   <ls:set-terminal-id><request:get-query-string /></ls:set-terminal-id>

 the xsl statment does not captures anything.

I have reduced the problem to an minimum(?) test case and included the
files at the end here. The files are:

 test-query.xml
 test-query.xsp.xsl
 test-query-html.xsl

Split the files where indicated and save them to a directroy somewhere
and add a line to the xsp file in cocoon.properties like this

 processor.xsp.logicsheet.ls.java = file:///<path>/test-query.xsp.xsl

restart apache and see whats happening. When I run this I get

  Terminal id = 935235235

using an explicit value and

  Terminal id =

when using the request statement ("?<some number>" was added to the
url of course).

Perhaps I'm not doing this in the right way somehow?

> - donald

best regards,
kmm





--- test-query.xml --- cut --- cut ---

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

<?cocoon-process type="xsp"?>
<?cocoon-process type="xslt"?>
<?xml-stylesheet href="test-query-html.xsl" type="text/xsl"?>

<xsp:page
  language="java"
  xmlns:xsp="http://www.apache.org/1999/XSP/Core"
  xmlns:request="http://www.apache.org/1999/XSP/Request"
  xmlns:ls="http://fou.telenor.com/ls"
>
<page>

 <ls:set-terminal-id><request:get-query-string /></ls:set-terminal-id>
<!--
 <ls:set-terminal-id>935235235</ls:set-terminal-id>
-->

 Terminal id = <ls:get-terminal-id />
</page>
</xsp:page>

--- test-query.xsp.xsl --- cut --- cut ---

<?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"
  xmlns:ls="http://fou.telenor.com/ls"
>

 <xsl:template match="xsp:page">
  <xsp:page>
   <xsl:copy>
    <xsl:apply-templates select="@*" />
   </xsl:copy>

   <xsp:logic>
    private String _terminal = "-1";
    private String _get_terminal_id() {
        return _terminal;
    }
    private String _set_terminal_id(String id) {
        _terminal = id;
        return "";
    }
   </xsp:logic>

   <xsl:apply-templates />
  </xsp:page>
 </xsl:template>

 <xsl:template match="ls:set-terminal-id">
  <xsp:expr>_set_terminal_id("<xsl:value-of select="." />")</xsp:expr>
 </xsl:template>

 <xsl:template match="ls:get-terminal-id">
  <xsp:expr>_get_terminal_id()</xsp:expr>
 </xsl:template>

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

</xsl:stylesheet>

--- test-query-html.xsl --- cut --- cut ---

<?xml version="1.0" encoding="ISO8859-1"?>

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="page">
<xsl:processing-instruction name="cocoon-format">
  type="text/html"
</xsl:processing-instruction>

<html>
 <head><title>TEST QUERY</title></head>
 <body bgcolor="#ffffff"><p><br /></p>

   <xsl:apply-templates/>

 </body>
</html>
</xsl:template>

</xsl:stylesheet>

Mime
View raw message