Subject: Re: [xsl] Pass variables through URL From: Anton Triest <anton@xxxxxxxx> Date: Tue, 19 Oct 2004 10:32:34 +0200 |
Here's the xslt file that has the url:Hi Jen,
<?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"
<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>
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>
<xsl:for-each select="/ROOT"> <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> </img> </xsl:for-each>
Here you'll need the upper and lower variables: <xsl:variable name="upper" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'"/> <xsl:variable name="lower" select="'abcdefghijklmnopqrstuvwxyz'"/> (mind the double quotes in the select attribute!)
Best regards, Anton
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Escape Special Characters, David Carlisle | Thread | Re: [xsl] Pass variables through UR, Jen Jiang |
[xsl] CLARIFICATION IN XML 2 XML TR, Arul Kumar | Date | Re: [xsl] union vs. "or" vs. contai, David Carlisle |
Month |