PDA

View Full Version : Help involving XSL and XSQL



ReaperFett
Mar 25th, 2004, 05:29:26 AM
I've been doing this for ages now with no success, and it's in late tommorow >_<


Okay, basically the question says:

"Construct the XSQL/XSLT pages that will generate XHTML for a web user to choose a play from those stored in the database. Then for the chosen play, the user should see the persona in the play, suitably formatted in XHTML"

The SQL tables in question (Relevent part shown) are:

CREATE TABLE play (
id varchar2(10),
title varchar2(200)
);
ALTER TABLE play add(CONSTRAINT play_pk PRIMARY KEY (id));

CREATE TABLE persona (
name varchar2(30),
playId varchar2(10),
description varchar2(200)
);
ALTER TABLE persona add(CONSTRAINT persona_pk PRIMARY KEY (name, playid));
ALTER TABLE persona add(CONSTRAINT persona_play_fk FOREIGN KEY (playId) REFERENCES play(id));


Now it has to work via pulldown, and It sortof works. The problem is that when I select a play, it wont show anything.

The files used are as follows:

cw_c.xsl

<?xml version="1.0" ?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>
<xsl:include href="xsqlerror.xsl" />
<xsl:include href="xsqlrequest.xsl" />
<xsl:include href="xsqlstatus.xsl" />
<xsl:output method="html" />

<xsl:template match="/">
<html>
<head>
<title>c01ndt coursework for MULT3005 - C</title>
</head>
<body>
<form method="GET" action="#">
<table>
<tr>
<td>
<select name="frmToShow">
<option value="None" >
-- View Which Cast List? --
</option>
<xsl:apply-templates select="*/ROWSET/ROW" />
</select>
</td>
<td>
<input type="submit" value="Retrieve" />
</td>
</tr>
</table>
</form>
<xsl:apply-templates select="//xsql-error" />
<xsl:apply-templates select="*/request" />
<xsl:apply-templates select="//xsql-status" />
</body>
</html>
</xsl:template>

<xsl:template match="ROW">
<option value="{id}">
<xsl:value-of select="concat( title, ' ')"/>
</option>
</xsl:template>
</xsl:stylesheet>



cw_c.xsql:

<?xml version="1.0" ?>
<?xml-stylesheet type="text/xsl" href="../xslt/cw_c.xsl" ?>
<page connection="c01ndt_oracle_candY+52" xmlns:xsql="urn:oracle-xsql">
<xsql:include-request-params />


<xsql:query>
SELECT
name AS "name",
playId AS "playId",
description AS "description"
FROM
c01ndt.persona
WHERE
playId =?
</xsql:query>

<xsql:query>
SELECT
title AS "title",
id AS "id"
FROM
c01ndt.play
</xsql:query>

<xsql:dml bind-params="frmToShow">
SELECT
title,
id
FROM
c01ndt.play
</xsql:dml>
</page>




Can anyone tell me what is going wrong? And there might be a few things, I know :)