Hello everyone,
I am relatively new to XML, and I'm having trouble multiplying parameters that I passed in from an XML document using using XSLT.
Here is my XML file:
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="Teacher.x sl"?>
<pay>
<sub1>30</sub1>
<hourlyRate>15. 75</hourlyRate>
</pay>
Here is my XSLT file:
<?xml version="1.0" ?>
<xsl:styleshe et version="1.0" xmlns:xsl="http ://www.w3.org/1999/XSL/Transform">
<xsl:template match="pay">
<html>
<body>
<xsl:apply-templates select="sub1"/>
<xsl:apply-templates select="hourlyR ate"/>
<xsl:value-of select="$onevar iable*$twovaria ble"/>
</body>
</html>
</xsl:template>
<xsl:template match="sub1">
<xsl:param name="onevariab le"/>
<br/><xsl:value-of select = "$onevariab le"/>
<br />Hours: <xsl:value-of select="."/>
</xsl:template>
<xsl:template match="hourlyRa te">
<xsl:param name="twovariab le"/>
<br/><xsl:value-of select="$twovar iable"/>
<br />Pay Rate: <xsl:value-of select="."/>
</xsl:template>
</xsl:stylesheet>
Basically, I have to to multiply onevariable and twovariable with the "$". I don't where in the document to declare it.
Thanks in advance for anyone who can help me with this problem.
(Sorry if the thread is long.)
I am relatively new to XML, and I'm having trouble multiplying parameters that I passed in from an XML document using using XSLT.
Here is my XML file:
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="Teacher.x sl"?>
<pay>
<sub1>30</sub1>
<hourlyRate>15. 75</hourlyRate>
</pay>
Here is my XSLT file:
<?xml version="1.0" ?>
<xsl:styleshe et version="1.0" xmlns:xsl="http ://www.w3.org/1999/XSL/Transform">
<xsl:template match="pay">
<html>
<body>
<xsl:apply-templates select="sub1"/>
<xsl:apply-templates select="hourlyR ate"/>
<xsl:value-of select="$onevar iable*$twovaria ble"/>
</body>
</html>
</xsl:template>
<xsl:template match="sub1">
<xsl:param name="onevariab le"/>
<br/><xsl:value-of select = "$onevariab le"/>
<br />Hours: <xsl:value-of select="."/>
</xsl:template>
<xsl:template match="hourlyRa te">
<xsl:param name="twovariab le"/>
<br/><xsl:value-of select="$twovar iable"/>
<br />Pay Rate: <xsl:value-of select="."/>
</xsl:template>
</xsl:stylesheet>
Basically, I have to to multiply onevariable and twovariable with the "$". I don't where in the document to declare it.
Thanks in advance for anyone who can help me with this problem.
(Sorry if the thread is long.)
Comment