Jump to content

rookwood

Members
  • Posts

    2
  • Joined

  • Last visited

rookwood's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. Thanks for taking the time to look at this; looks like i can learn some good stuff from your approach. I actually managed to kludge it yesterday using xsl:if to test for absence of data in the element and inserting " <br> " where that was the case. It was a last straw approach and bizarrely worked fine. Whilst trawling the web I came across several examples of tables built from xml and stylesheet which all sufferred the same rendering problem in my versions of Explorer (v6.02). Annoying since Outlook shares the HTML/xml rendering engine and the end game of my work is generating HTML e-mail for my client from xml input.CheersG
  2. Hi, I've built a stylesheet that displays the content of my xml message as an Html table. It all works fine as long as the element has non-blank space content. However, when elements contain a blankspace or no content the table renders incorrectly. i.e the individual <td></td> elements display with no table border.I've been trying to insert entities in the empty cells but can't seem to get that to work.sample msg:<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="instrument_table.xsl" ?><Instruments><changed> <ID_BB_UNIQUE>ABCDEFG</ID_BB_UNIQUE> <ID_SEDOL1>S02548</ID_SEDOL1> <ID_SEDOL2> </ID_SEDOL2> <ID_SEDOL3></ID_SEDOL3> <TICKER>BA</TICKER> </changed><changed> <ID_BB_UNIQUE>PQRSTUV</ID_BB_UNIQUE> <ID_SEDOL1>B0JYD4</ID_SEDOL1> <ID_SEDOL2>B095JTY</ID_SEDOL2> <ID_SEDOL3></ID_SEDOL3> <TICKER>BA</TICKER></changed></Instruments>Stylesheet:<xsl:output method="xml" indent="yes" media-type="text/xml"/><xsl:template match="/Instruments"><html xsl:version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/TR/xhtml1/strict"><head><title>Instrument changes</title></head><body><font face="arial"><table> <tr> <td> <p>Instrument List</p> </td> </tr><tr><td> <table border='1' cellpadding='5' align='Left'> <tr bgcolor="#cccccc"> <th>BLOOMBERG ID</th> <th>SEDOL1</th> <th>SEDOL2</th> <th>SEDOL3</th> <th>TICKER</th> </tr> <xsl:for-each select="changed"> <tr> <td><xsl:value-of select="ID_BB_UNIQUE"/></td> <td><xsl:value-of select="ID_SEDOL1"/></td> <td><xsl:value-of select="ID_SEDOL2"/></td> <td><xsl:value-of select="ID_SEDOL3"/></td> <td><xsl:value-of select="TICKER"/></td> </tr> </xsl:for-each> </table></td></tr></table></font></body></html></xsl:template></xsl:stylesheet>Anyone have a bright idea?CheersG
×
×
  • Create New...