Oceans Posted July 13, 2010 Share Posted July 13, 2010 I have a rather large xslt file which is working fine except for one thing. There is a bit of extra code that keeps showing up in the final xhtml output.This is the output with the bold red bit the unwanted code. If I delete parts of the xslt code, that bit of unwanted code will move to a different table. Needless to say, it does not validate and I want to get rid of it. <table bgcolor="#d5e3f2" border="0" cellpadding="5" cellspacing="1" width="100%"> <tbody><tr> <td style="background-image: url("../Images/header.png");" class="grey" align="left" bgcolor="#f8fafd" height="22" valign="top" width="52%">SPEC</td> </tr> <tr> <td class="small-text-black" align="left" bgcolor="#f8fafd" height="38" valign="top">Travel, Arts, Marketing</td> </tr> </tbody></table> <table[color="#FF0000"][b] xmlns=""[/b][/color] bgcolor="#d5e3f2" border="0" cellpadding="5" cellspacing="1" width="100%"> <tbody><tr> <td style="background-image: url("../Images/header.png");" class="grey" align="left" bgcolor="#f8fafd" height="22" valign="top" width="52%">Cost</td> </tr> <tr> <td align="left" bgcolor="#f8fafd" height="38" valign="top"> <table class="small-text-black" bgcolor="#cccccc" border="0" cellpadding="2" cellspacing="1" width="100%"> <tbody><tr> <td bgcolor="#f4f4f4">Price (USD) </td> <td bgcolor="#f4f4f4">Min</td> <td bgcolor="#f4f4f4">Max</td> </tr> This is some of the xslt code: <?xml version="1.0" encoding="utf-8"?><xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" version="1.0" encoding="utf-8" indent="yes"/> <xsl:template match="USER"> <html xmlns="http://www.w3.org/1999/xhtml">...removed code. <table bgcolor="#D5E3F2" border="0" cellpadding="5" cellspacing="1" width="100%"> <tr> <td style="background-image: url(../Images/header.png);" class="grey" align="left" bgcolor="#f8fafd" height="22" valign="top" width="52%"><xsl:value-of select="MULTILANGUAGE/SPEC"/></td> </tr> <tr> <td class="small-text-black" align="left" bgcolor="#F8FAFD" height="38" valign="top" > <xsl:value-of disable-output-escaping="yes" select="INDUSTRY/SUBJECTNAME"/> </td> </tr> </table> <xsl:value-of select="MULTILANGUAGE/NEWLINECHAR" disable-output-escaping="yes"/> <xsl:apply-templates select="PRICES"> <xsl:with-param name="price" select="MULTILANGUAGE/PRICING"/> <xsl:with-param name="termsofpayment" select="MULTILANGUAGE/TERMSOFPAYMENT"/> </xsl:apply-templates> <xsl:value-of select="MULTILANGUAGE/NEWLINECHAR" disable-output-escaping="yes"/> <xsl:if test="INDUSTRY/ISAVAILABILITY = '1' or INDUSTRY/ISIM = '1' or INDUSTRY/DISTANCE/text()"> <table width="100%" border="0" cellpadding="5" cellspacing="1" bgcolor="#D5E3F2"> <tr> <td width="52%" align="left" height="22" valign="top" style="background-image: url(../Images/header.png);" bgcolor="#F8FAFD" class="grey"> <xsl:choose> <xsl:when test="INDUSTRY/ISAVAILABILITY = '1' "> <xsl:value-of select="MULTILANGUAGE/GRIDTXT"/> </xsl:when> </xsl:choose> </td>. </tr>.removed code.. <xsl:template match="PRICES"> <xsl:param name="price"/> <xsl:param name="termsofpayment"/> <xsl:value-of select="MULTILANGUAGE/NEWLINECHAR" disable-output-escaping="yes"/> <table bgcolor="#d5e3f2" border="0" cellpadding="5" cellspacing="1" width="100%"> <tr> <td style="background-image: url(../Images/header.png);" class="grey" align="left" bgcolor="#F8FAFD" height="22" valign="top" width="52%"> <xsl:value-of select="$price"/></td> </tr> <tr> <td height="38" valign="top" bgcolor="#F8FAFD" align="left"> I really need some guidance what to do to get this to work. I am guessing there is a default template at work. Even with that knowledge I do not know what to do next. Link to comment Share on other sites More sharing options...
Martin Honnen Posted July 13, 2010 Share Posted July 13, 2010 Put the xmlns="http://www.w3.org/1999/xhtml" on the xsl:stylesheet element, not on the html element (as that is inside a template). Link to comment Share on other sites More sharing options...
Oceans Posted July 13, 2010 Author Share Posted July 13, 2010 Put the xmlns="http://www.w3.org/1999/xhtml" on the xsl:stylesheet element, not on the html element (as that is inside a template).That worked, Thanks. I have been working on this for so long! Thanks! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.