XSLT not displaying all results

Xstinct

New Member
I have an XML document containing contact information as seen below:\[code\]<contact type="individual"> <firstname>Some</firstname> <surname>Guy</surname> <organisation> <name>London School of Espionage</name> </organisation> <address> <line1>Houghton St</line1> <cityortown>London</cityortown> <postalcode>WC2A 2AE</postalcode> <country>UK</country> </address> <telephone prefix="+44" type="work"> <areacode>020</areacode> <number>71239876</number> </telephone> <telephone prefix="+44" type="mobile"> <areacode>07123</areacode> <number>543098</number> </telephone> <email type="work">[email protected]</email> <email type="personal">[email protected]</email> <fax prefix="+44" type="work"> <areacode>020</areacode> <number>78001234</number> </fax> <website>www.espionage.co.uk</website></contact>\[/code\]I have an XSL template which should show all the information in a table, but only the first email address is displaying. Please could someone advise on what I'm doing wrong:\[code\]<?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"version="1.0"><xsl:template match="/"><html> <head> <link rel="stylesheet" type="text/css" href="http://stackoverflow.com/questions/9847522/contacts.css"/> </head> <body> <div id="main"> <h1 align="center">XML Contact Book</h1> <table> <tr><th>Name</th> <th>Organisation</th> <th>Address</th> <th>Email</th> <th>Telephone</th> <th>Fax</th> <th>Website</th></tr> <xsl:for-each select="contacts/contact/."> <tr> <td valign="bottom"><xsl:value-of select="firstname"/> <xsl:value-of select="surname"/></td> <td valign="bottom"><xsl:value-of select="organisation/name"/></td> <td valign="bottom" width="200px"><xsl:value-of select="address/line1"/><br/> <xsl:value-of select="address/line2"/><br/> <xsl:value-of select="address/line3"/><br/> <xsl:value-of select="address/cityortown"/><br/> <xsl:value-of select="address/countyorstate"/><br/> <xsl:value-of select="address/postalcode"/><br/> <xsl:value-of select="address/country"/><br/></td> <!--creates a mailto: link for the email address contained in contacts.xml--> <td valign="bottom"><a><xsl:attribute name="href">mailto:<xsl:value-of select="email"/></xsl:attribute><xsl:value-of select="email"/></a> <br/><p><xsl:value-of select="email/@type"/> email</p></td> <td valign="bottom"><p>Prefix: <xsl:value-of select="telephone/@prefix"/></p> <xsl:value-of select="telephone/areacode"/> <xsl:value-of select="telephone/number"/></td> <td valign="bottom"><p>Prefix: <xsl:value-of select="fax/@prefix"/></p><xsl:value-of select="fax/areacode"/> <xsl:value-of select="fax/number"/></td> <!--creates hyperlink to website listed in contact details--> <td valign="bottom"><a><xsl:attribute name="href">http://<xsl:value-of select="website"/></xsl:attribute><xsl:value-of select="website"/></a></td> <hr/> </tr> </xsl:for-each> </table> </div> </body></html></xsl:template>\[/code\]
 
Top