I am trying to take the follwing XML
I need to cycle through the available image tags and print them into 5 column table. Here is my current xslt:
I am certain this will be simple, but I can't find any samples. Any suggestions?
Code:
<?xml version="1.0" encoding="utf-8" ?>
<webmedia>
<subject name="20040727_OurHouse">
<images>
<image
id="20040727_OurHouse1"
name="20040727_01_OurHouse.jpg"
href="images/20040727_OurHouse/"
tname="t20040727_OurHouse1"
tdir="images/20040727_OurHouse/thumb/"
/>
<image
id="20040727_OurHouse2"
name="20040727_02_OurHouse.jpg"
href="images/20040727_OurHouse/"
tname="t20040727_OurHouse2"
tdir="images/20040727_OurHouse/thumb/"
/>
</images>
</subject>
</webmedia>
I need to cycle through the available image tags and print them into 5 column table. Here is my current xslt:
Code:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="[URL unfurl="true"]http://www.w3.org/1999/XSL/Transform">[/URL]
<xsl:output doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN" doctype-system="[URL unfurl="true"]http://www.w3.org/TR/html4/strict.dtd"[/URL] />
<xsl:param name="Key"/>
<xsl:template match="/" >
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252" />
<xsl:element name="link">
<xsl:attribute name="rel">stylesheet</xsl:attribute>
<xsl:attribute name="href">../styles/main.css</xsl:attribute>
</xsl:element>
<title>Our Multimedia</title>
<SCRIPT language="javascript" type="text/javascript">
function leave()
{
box = document.forms[0].subbox;
location.href= 'index.asp?Key=' + box.options[box.selectedIndex].value;
}
</SCRIPT>
</head>
<body>
<div class="hdrcontainer">
<div class="hdr_background">Raker's Layer</div>
<div class="hdr_foreground">Raker's Layer</div>
<div class="hdr_subtitle">...See and Hear It</div>
</div>
<div class="treebuttonscontainer ">
<div class="treebuttons ">
<a href="/articles">Articles</a>
<a href="/news">Past News</a>
<span class="atPage">Media</span>
<a href="/myscripts">Scripts</a>
<a href="/fockers">Fockers United</a>
<a href="/">Home</a>
</div>
</div>
<div class="mainBody">
<form name="bdy">
<select name="subbox" onChange="javascript:leave();">
<option value="">-- Select a Library --</option>
<xsl:for-each select="webmedia/subject">
<option>
<xsl:attribute name="value">
<xsl:value-of select="@name" />
</xsl:attribute>
<xsl:value-of select="@name" />
</option>
</xsl:for-each>
</select>
<br />
<xsl:for-each select="webmedia/subject[@name=$Key]">
<table border="1">
<tr>
<td>
<xsl:value-of select="@name" />
</td>
</tr>
<xsl:for-each select="images/image">
<tr>
<td>
<xsl:value-of select="@name" />
</td>
</tr>
</xsl:for-each>
</table>
</xsl:for-each>
</form>
</div>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
I am certain this will be simple, but I can't find any samples. Any suggestions?