XML and JavaScript?

webmasterbeta

New Member
Hello all,

For school I抳e got an assignment to create a XHTML document showing recipes from a XML file. So far no problem but this can be done many ways. One of these is by using XSL or putting the data dynamicly into a table. I prefer using XSL but the part where I get stuck is the following:

I have to list all recipes and their ingredients and per ingredient show how much of it to use and what the price is. This I have to multiply with eachother and also sum the total costs. It could be done using Javascript but I can抰 find a way to call the javascript function doing this for each node I want to do the math with.

I would like it best if I could do something like:

<xsl:value-of select="calc(ingredient,price)"/>

But I can抰 get it to work. After some searching it seems this method is deprecated, is that true?

Otherwise I probably have to dynamicly create the table using JavaScript? But I wouldn抰 prefer that because it seems to me to be a bit to complicated. I probably can do it but I抎 prefer the more simple method.

Please shed some light on this one.

Thanks !
 
Back
Top