Subject:HTML Tag using "value-of" XML element as a parameter Author:Craig Johnson Date:15 Feb 2006 12:47 PM
Forgive my going about this all wrong, but...
I want to create what looks like a graph using data from an XML and XSL documents. I thought, well, a series of one rowed tables, having a value as the first (fixed width) column, and the "width" of the second column being equal to that value. Ok. I first started by creating an HTML document hard coding in the values, like this...
Bored yet? Anyhow, my idea was to use the values of the GameScores and ScorePlayer data to replace the hard-coded values.
I know I'm really mistreating XML, but my attempts at this approach yielded this XSL...
The commented out lines are what obviously invalidate the XSL document, but it illustrates efficiently my lack of understanding of XML and how my approach to this issue is about 90 degrees off course. I know that the second record (because of my hard coded values) is incorrectly displayed as a graph bars, but other than that, the given example produces a runnable XML document that shows 4 bars.
Get the idea? Any suggestions on a new approach? I want to use the values 158 (row1/field3), 39 (row1/field4), 320 (row2/field3), and 36 (row2/field4) as the "width" parameter of my <td>.
Thanks for taking the time to review this, and I'm open to helpful critique.
The "*.25" was added to keep the graph on a reasonable size page width, and the hours were added to the first column, but it all works pretty well. Very good exercise!
Thank you everyone for your interest and assistance.