Jump to content

Bakumba

Members
  • Posts

    2
  • Joined

  • Last visited

Everything posted by Bakumba

  1. Hi, thanks for the reply.Tried implementing your changes but it doesnt work. im only getting the following when opening the XML file using IE:Email ListingFrom: () To: () Subject: any ideas?thanks
  2. Hi,Im trying to create a stylesheet to show a 'mailbox' xml file (a xml file with a series of email messages) with a table accomodating each email address. below is what i have but its not working:the xml file:<?xml version='1.0'?><?xml-stylesheet type="text/xsl" href="email.xsl" ?><mailbox><email><from><name>Les Carr</name> <address>lac@ecs.soton.ac.uk</address></from><to><name>Hugh Davis</name> <address>hcd@multicosm.com</address></to><subject>Teaching Duties</subject><content>Using Java to teach Programming Principles seems to have worked verywell. The standard of software engineering seems to have increased.</content></email><email><from><name>Wendy Hall</name> <address>wh@ecs.soton.ac.uk</address></from><to><name>Les Carr</name> <address>lac@ecs.soton.ac.uk</address></to><subject>XML Course</subject><content>Please make sure that you use the new IAM logo on all ourcourse material.</content></email><email><from><name>Les Carr</name> <address>lac@ecs.soton.ac.uk</address></from><to><name>Wendy Hall</name> <address>wh@ecs.soton.ac.uk</address></to><subject>Re: XML Course</subject><content>Have you looked at the content?</content></email></mailbox>the .xsl file<?xml version='1.0'?><xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl" ><xsl:template match="*"> <xsl:apply-templates/></xsl:template><xsl:template match="/"> <H1>Email Listing</H1> <xsl:for-each select="mailbox/email"> <table> <xsl:apply-templates/> </table> </xsl:for-each></xsl:template><xsl:template match="//from"> <tr><td>From:</td><td><xsl:value-of select="name"/> (<xsl:value-of select="address"/>)</td></tr></xsl:template><xsl:template match="//to"> <tr><td>To:</td><td><xsl:value-of select="name"/> (<xsl:value-of select="address"/>)</td></tr></xsl:template><xsl:template match="//subject"> <tr><td>Subject:</td><td><xsl:value-of select="."/> </td></tr></xsl:template><xsl:template match="//content"> <tr><td colspan="2"><xsl:value-of select="."/></td></tr></xsl:template></xsl:stylesheet>Can someone kindly let me know where im being stupid?Thanks a lot
×
×
  • Create New...