I'm currently using a Google Stock API to retrieve information from the internet about stocks. (Done in C#). The C# code retrieves all the values. I then want to be able to display this information (which includes a few doubles and a string that links to an image) in my .XSLT file (using JavaScript). How would I go about doing this? I've tried looking on Google, but nothing seems clear enough to me.
2 Answers
Your question is quite confusing, but I am guessing this is what your looking for?
<%
string artist = "some artist";
string title = "some title";
%>
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<h2>My CD Collection</h2>
<table border="1">
<tr bgcolor="#9acd32">
<th>Title</th>
<th>Artist</th>
</tr>
<xsl:for-each select="catalog/cd">
<tr>
<td><xsl:value-of select="<%=title%>"/></td>
<td><xsl:value-of select="<%=artist%>"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
2 Comments
Roman
If you're going to post code, you should try to include likely vocabulary from the question (in this case stock prices) as opposed to less relevant vocabulary (in this case CD collection).
Hani Honey
Basically, I'm trying to do something like this:wackylabs.net/2007/10/… It's the second method...and I just can't figure out what they're wanting me to do. Where do I put the XsltArgumentList args part of the code?
System.Xml.Xsl.XslCompiledTransform- not sure how javascript factors in this, though