cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nick Tackes <N...@Qstrategies.com>
Subject Passing parameters between xmls using cocoon
Date Fri, 14 Jul 2000 14:49:20 GMT


Greetings,

I am trying to pass a parameter from 1 xml file, prepared in an href tag in
an xslt, to another xml file.
How would I do this with cocoon?  

In my example here, I have two groups of records.  The XSL below a link is
constructed ...

							<tr>
	
<xsl:variable name="xlink"
select="concat('/content/xml/TESTKPI.CXML?',$rname)"/>
								<a
href="{$xlink}" target="Global KPI List">More KPIs ...</a>
								<!--a
href="/content/xml/TESTKPI.CXML?&{$rlink}" target="Global KPI List">More
KPIs ...</a-->
							</tr>

that contains a parameter of the group.

Next, my xml has to pull this parameter in.  Can I do this with XSP?

Any help is greatly appreciated.
thank you.

************************
my xml file
************************

<?xml version="1.0"?>
<?xml-stylesheet href="TESTKPI-all.xsl" type="text/xsl"?>
<?cocoon-process type="xslt"?>
<TextKPIConfig>
	<Group Name="eCommerce">
		<TextKPI Name="SalesAmount" Description="Total Sales Amount"
Value="$50,392.00" Link="/applet_table3.html" Show="Y"/>
		<TextKPI Name="NumberofOrders" Description="Total Number of
Orders" Value="1,552" Link="/applet_table3.html" Show="Y"/>
		<TextKPI Name="OrderQuantity" Description="Total Product
Order Quantity" Value="1,552" Link="/applet_table3.html" Show="N"/>
		<TextKPI Name="AverageSales" Description="Average Sales
Amount" Value="$12,682.00" Link="/applet_table3.html" Show="Y"/>
	</Group>
	<Group Name="Financial">
		<TextKPI Name="CashInHand" Description="Total Cash In Hand"
Value="$155,785.00" Link="/applet_table3.html" Show="Y"/>
		<TextKPI Name="NetAR" Description="Net Accounts Receivable"
Value="$429,292.00" Link="/applet_table3.html" Show="Y"/>
		<TextKPI Name="TotalInventories" Description="Total
Inventories" Value="$698,075.00" Link="/applet_table3.html" Show="Y"/>
		<TextKPI Name="TotalAssets" Description="Total Assets"
Value="$1,392,634.00" Link="/applet_table3.html" Show="Y"/>
		<TextKPI Name="TotalLiabilities"
Description="TotalLiabilities" Value="$349,709.00"
Link="/applet_table3.html" Show="N"/>
		<TextKPI Name="ShareholdersEquity" Description="Total
Shareholders' Equity" Value="$1,042,925.00" Link="/applet_table3.html"
Show="N"/>
	</Group>
</TextKPIConfig>


*********************
my xsl file
*********************
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0" xmlns:java="http://xml.apache.org/xslt/java"
exclude-result-prefixes="java">
	<xsl:template match="/">
		<HTML>
			<head>
				<title>User KPI List</title>
			</head>
			<body>
				<xsl:for-each select="TextKPIConfig/Group">
					<div
STYLE="background-color:#BEBEC6; color:black; padding:4px">
						<xsl:variable name="rname"
select="@Name"/>
						<!--xsl:value-of
select="@Name"/-->
					</div>
					<table width="300">
						<xsl:for-each
select="TextKPI">
						<xsl:if test="@Show='Y'">
							<tr>
								<td
width="60%">
	
<xsl:value-of select="@Description"/>
								</td>
								<td>
	
<xsl:variable name="rlink" select="@Link"/>
									<a
href="{$rlink}" target="KPI Report">
	
<xsl:value-of select="@Value"/>
									</a>
								</td>
	
<!--xsl:variable name="rfile" select="string(File)"/>
	
<xsl:variable name="linkbuilder"
select="java:com.sun.java.linkgen.ViewLinkBuilder.new($rfile)"/>
	
<xsl:variable name="rlink" select="java:GetURLString($linkbuilder)"/>
								<a
href="{$rlink}">
	
<xsl:value-of select="Name"/>
								</a-->
							</tr>
							</xsl:if>
						</xsl:for-each>
						<tr ><td
height="30"></td></tr>
							<tr>
	
<xsl:variable name="xlink"
select="concat('/content/xml/TESTKPI.CXML?',$rname)"/>
								<a
href="{$xlink}" target="Global KPI List">More KPIs ...</a>
								<!--a
href="/content/xml/TESTKPI.CXML?&{$rlink}" target="Global KPI List">More
KPIs ...</a-->
							</tr>
					</table>
				</xsl:for-each>
			</body>
		</HTML>
	</xsl:template>
</xsl:stylesheet>

Mime
View raw message