You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Nicholas Hemley <ni...@realtime.co.uk> on 2000/04/27 16:06:11 UTC

XSP processing (aka blundering in the dark)

Forgive my blunderings, but i am a little confused as to the following
behaviour:

If my XSP taglib file is NOT an XSL stylesheet (in contrast to Brett's
example in Chapter 9) i get the following output to the browser:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"
                      "http://www.w3.org/TR/REC-html40/strict.dtd">
<queryString><parameter name="foo" value="bar"></parameter><parameter
name="id" value="1"></parameter></queryString>

Please could someone explain why the output is not XML if XSPs are in
fact custom producers?!

How do I now use an XSLT transformation on this output if all other PIs
have been consumed?

Nic.
Source file shown below:
---------------------------------------------
<?xml version="1.0"?>

<xsp:page language="java"
            xmlns:xsp="http://www.apache.org/1999/XSP/Core"
            xmlns:query="http://www.realtime.co.uk">

<queryString>
  <xsp:logic> <![CDATA[
      Enumeration e = request.getParameterNames();

      while(e.hasMoreElements())
      {
        String param = (String)e.nextElement();
    ]]>
  </xsp:logic>

<parameter>
<xsp:attribute name="name">
  <xsp:expr>param</xsp:expr>
</xsp:attribute>
<xsp:attribute name="value">
  <xsp:expr>request.getParameter(param)</xsp:expr>
</xsp:attribute>
</parameter>

<xsp:logic>
<![CDATA[ } ]]>
</xsp:logic>

</queryString>

</xsp:page>