Arif,
you aren't doing anything to obtain the user's input. Are you familiar
with HTML forms in CGI or Servlet programming or anything like that? If
not, you might want to get a book on Servlets or some such.
Anyway, try modifying your XML to something like this:
<?xml version="1.0"?>
<?cocoon-process type="xsp"?>
<?cocoon-process type="xslt"?>
<?xml-stylesheet href="ref.xsl" type="text/xsl"?>
<xsp:page
xmlns:xsp="http://www.apache.org/1999/XSP/Core" language="java"
>
<xsp:logic>
String input = request.getParameter("user");
String msg;
if (input == null || "".equals(input)) {
msg = "Hello, world!";
} else {
msg = input;
}
</xsp:logic>
<title>
<xsp:expr>msg</xsp:expr>
</title>
</xsp:page>
Also take a look at the documentation on the Request logicsheet (it is on
the Cocoon2 site, but it is actually written for Cocoon 1).
-Christopher
Please respond to [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
cc:
Subject: xml/xsl/xsp
hi,
please could you give me a hand with this.
need help
ok ive got this far, needed to create an HTML form with a text input field
-
which ive done
what i need to do - using xml&xsl, create an HTML form
that submits to the page that i created i the(the xml & xsl file
i created that generated an HTML page saying Hello World)
which should be modified to display any text entered by the user instead of
Hello World.
i ran it it does not work, where am i going wrong?
my xml is not picking up what i type in the message field
any help please?
using apache webserver with cocoon
XML FILE
<?xml version="1.0"?>
<?cocoon-process type="xsp"?>
<?cocoon-process type="xslt"?>
<?xml-stylesheet href="ref.xsl" type="text/xsl"?>
<xsp:page
xmlns:xsp="http://www.apache.org/1999/XSP/Core" language="java"
>
<xsp:logic>
String msg = "Hello, world!";
</xsp:logic>
<title>
<xsp:expr>msg</xsp:expr>
</title>
</xsp:page>
xsl file
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<h1 style="color:green;"><xsl:value-of select="//title"/></h1>
</xsl:template>
</xsl:stylesheet>
HTML FILE
<html>
<head>
</head>
<body>
<form name="input" action="/resweb/arif/ref.xml">
Message Text:
<input id="user" type="text" name="user">
<input type="submit" value="Submit">
</form>
</body>
</html>
thanks
arif
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>