cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kai.Reh...@pass-consulting.com
Subject AW: Problem with variables
Date Thu, 19 Oct 2000 14:21:00 GMT
To make my self clear:

Here the xml file which gets a variable entered by user "K4"

*************************************************************************
<?xml version="1.0" encoding="UTF-8"?>
<?cocoon-process type="sql"?>
<?xml-stylesheet href="./Level5.xsl" type="text/xsl"?>
<?cocoon-process type="xslt"?>
<page>
	<connectiondefs>
		<connection name="FF">
			<driver>COM.ibm.db2.jdbc.app.DB2Driver</driver>
			<dburl>jdbc:db2:FF</dburl>
			<username>****</username>
			<password>****</password>
		</connection>
	</connectiondefs>
	<query connection="FuE">select c.catid, c.name, cat.cat_catid,
cat.catid 
						from category as c, cat_cat
as cat
						where cat.catid = {@K4} and
c.catid = cat.cat_catid
	</query>
</page>

***************************************************************************

and here the according stylesheet where I need to put the variable "K4"
again 
somehow if I wish to pass it to the next site. I know if the query returns
something
I have the variable, but what to do if it doesn't??

***************************************************************************
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" 
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>
<xsl:template match="/">
<body bgcolor="orange">
	<form id="Level5" action="../request.xml" method="post"
target="_top">
		
		<xsl:if test="page / ROWSET / ROW  != '0'">
	
		<select name="K" style="width=120" onchange="form.submit()">
			<optgroup label="Category 5">
				<option value="0">Select</option>
				<xsl:for-each select="page / ROWSET / ROW">
				<xsl:variable name="ID"><xsl:value-of
select="CATID"/></xsl:variable>
				<option value="{$ID}">
					<xsl:value-of
select="NAME"></xsl:value-of>
				</option>

			</xsl:for-each>
			</optgroup>
		</select>
		</xsl:if>
		
		......

	</form>
</body>
</xsl:template>
</xsl:stylesheet>
*******************************************
Thank's 

Mime
View raw message