On Fri, 28 Nov 2003 04:02:51 GMT,
le*****************@singnet.com.sg
(Ken) wrote:
Thanks Devon. I use your method and can't seem to return the required
elements. Can you tell me what's wrong with the code below? The code
is adapted from http://www.w3schools.com/xsl/xsl_value_of.asp
Try this:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:variable name="doc"
select="document('http://www.w3schools.com/xsl/cdcatalog.xml')"/>
<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="$doc/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>
If you want to see it quickly in client-side IE, save it as
xsl_document.xsl and try browsing the following xml document
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="xsl_document.xsl" ?>
<foo />
--
Die Gotterspammerung - Junkmail of the Gods