Subject: Re: Pass variables through URL
From: Jen Jiang <zhenjiang14221@xxxxxxxxx>
Date: Mon, 18 Oct 2004 18:33:29 -0700 (PDT)
|
Here's the xslt file that has the url:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href="cascademenu_member.xsl"/>
<xsl:import href="footer.xsl"/>
<xsl:import href="menubarh.xsl"/>
<xsl:import href="menubarh_member.xsl"/>
<xsl:import href="header.xsl"/>
<xsl:output method="text/html"
encoding="iso-8859-1"/>
<xsl:template match="/">
<html>
<head>
<title>View all the upcoming events</title>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1"/>
<link rel="stylesheet" href="../style/style.css"
type="text/css"/>
<link rel="stylesheet"
href="../style/cascademenu.css" type="text/css"/>
<!--xsl:import href="cascademenu_member.xsl"/-->
<xsl:call-template name="cascademenu_member" />
</head>
<body bgcolor="#8080C0" marginwidth="0"
marginheight="0" style="margin: 0"
onLoad="writeMenus()" onResize="if (isNS4)
nsResizeHandler()">
<!--xsl:import href="header.xsl" /-->
<xsl:call-template name="header" />
<!--Start of repeating part-->
<table width="100%" border="0" align="center"
cellpadding="10">
<!--xsl:import href="menubarh.xsl" /-->
<xsl:call-template name="menubarh_member" />
<tr bgcolor="#6699FF">
<td width="18%" valign="top" bgcolor="#CCCCCC">
<font color="#FFFF33" face="Verdana, Arial,
Helvetica, sans-serif" size="2">
<div align="right"> </div>
</font>
</td>
<td bgcolor="#FFFFFF" valign="top" height="400">
<!--End of repeating part-->
<div align="center">
<xsl:for-each select="ROOT">
<xsl:variable name="age1">
<xsl:value-of select="AGE1"/>
</xsl:variable>
THIS IS AGE1:<xsl:value-of select="$age1"/>
<xsl:variable name="age2">
<xsl:value-of select="AGE2"/>
</xsl:variable>
<xsl:variable name="age3">
<xsl:value-of select="AGE3"/>
</xsl:variable>
<xsl:variable name="age4">
<xsl:value-of select="AGE4"/>
</xsl:variable>
<xsl:variable name="age5">
<xsl:value-of select="AGE5"/>
</xsl:variable>
<xsl:variable name="age6">
<xsl:value-of select="AGE6"/>
</xsl:variable>
<xsl:variable name="age7">
<xsl:value-of select="AGE7"/>
</xsl:variable>
<xsl:variable name="age8">
<xsl:value-of select="AGE8"/>
</xsl:variable>
<xsl:element name='img'>
<xsl:attribute name='src'>
<xsl:text>./php/chart_age.php?age1=</xsl:text>
<xsl:value-of select='$age1'/>
<xsl:text>&age2=</xsl:text>
<xsl:value-of select='$age2'/>
<xsl:text>&age3=</xsl:text>
<xsl:value-of select='$age3'/>
<xsl:text>&age4=</xsl:text>
<xsl:value-of select='$age4'/>
<xsl:text>&age5=</xsl:text>
<xsl:value-of select='$age5'/>
<xsl:text>&age6=</xsl:text>
<xsl:value-of select='$age6'/>
<xsl:text>&age7=</xsl:text>
<xsl:value-of select='$age7'/>
<xsl:text>&age8=</xsl:text>
<xsl:value-of select='$age8'/>
</xsl:attribute>
</xsl:element>
</xsl:for-each>
</div>
</td>
</tr>
</table> <xsl:call-template name="footer" />
</body>
</html>
</xsl:template>
</xsl:stylesheet>
And the XML file that has the values of age1-age8.
<?xml version="1.0" encoding="UTF-8"?>
<ROOT>
<AGE1>30</AGE1>
<AGE2>10</AGE2>
<AGE3>30</AGE3>
<AGE4>10</AGE4>
<AGE5>20</AGE5>
<AGE6>0</AGE6>
<AGE7>0</AGE7>
<AGE8>0</AGE8>
</ROOT>
Thanks...
--- "Werner, Wolfgang" <mail@xxxxxxxxxxxxxxxxxxx>
wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> I assume that AGE1 is the name of the element whose
> content you want to
> set the variable to, and not the value the variable
> should have.
>
> Do you set the variable in the same template you
> construct the URL?
>
> I think it would help if you posted your stylesheet
> and an example input
> file to reproduce the error
>
> Wolfgang
>
> Jen Jiang wrote:
>
> | This is how I set the variables:
> | <xsl:variable name="age1">
> | <xsl:value-of select="AGE1"/>
> | </xsl:variable>
> | ...
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.4 (Cygwin)
> Comment: Using GnuPG with Thunderbird -
> http://enigmail.mozdev.org
>
>
iD8DBQFBc3GuqjaicDyx8o8RAiNXAJ9CZKJePFvL+YRmYY48teLR0IyePwCgiHWA
> 7bjP6rPsVnM0OIJwbdo7Io4=
> =mM+5
> -----END PGP SIGNATURE-----
>
>
_______________________________
Do you Yahoo!?
Declare Yourself - Register online to vote today!
http://vote.yahoo.com
| Current Thread |
- Re: Pass variables through URL, (continued)
- Jen Jiang - Sun, 17 Oct 2004 12:50:17 -0700 (PDT)
- Werner, Wolfgang - Sun, 17 Oct 2004 22:33:25 +0200
- Jen Jiang - Sun, 17 Oct 2004 13:54:22 -0700 (PDT)
- Werner, Wolfgang - Mon, 18 Oct 2004 09:33:02 +0200
- Jen Jiang - Mon, 18 Oct 2004 18:33:29 -0700 (PDT) <=
- Werner, Wolfgang - Tue, 19 Oct 2004 09:52:11 +0200
- Jen Jiang - Tue, 19 Oct 2004 19:12:56 -0700 (PDT)
- Werner, Wolfgang - Wed, 20 Oct 2004 09:28:02 +0200
- Jen Jiang - Sun, 24 Oct 2004 16:15:54 -0700 (PDT)
|
|