[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: SV: xsl doesnt produce valid xhtml
I did this but it still isnt working, xtrans complains that the <tr> tag
doesnt match the <xsl:when> tag, in other words its looking for the closing
tag but not finding anything. I have tested it replacing teh tr tags for
letter TR and the test produces valid xhtml???:
?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="xml" encoding="UTF-8" indent="yes" omit-xml-declaration="yes"/> <xsl:variable name="Digits" select="1234567890"/> <xsl:template match="ves"> <html> <table> <xsl:apply-templates select="ve[not(contains(@pos, '.'))]" /> </table> </html> </xsl:template> <xsl:template match="ve"> <xsl:variable name="rowspan" select="@des" /> <xsl:choose> <!--TYPE--> <xsl:when test="entrydata/@colno='0'"> <!--<tr align="Left" valign="Top">--><tr><!--HEREHERE--> <td rowspan="{$rowspan}" bgColor="#FFFFC2" valign="Middle"> <xsl:choose> <xsl:when test="entrydata/text=''"> <B>-Uncategorised Type-</B> </xsl:when> <xsl:otherwise> <B><xsl:value-of select="entrydata/text" /><xsl:value-of select="@pos" /></B> </xsl:otherwise> </xsl:choose> </td> </xsl:when> <!--RESPONSIBILITY, 1 dot--> <xsl:when test="entrydata/@colno='1'"> <xsl:choose> <xsl:when test="((count(../ve/@pos[string-length(translate(.,$Digits,'')) = 1])) > 1) and substring(current()/@pos, string-length(current()/@pos),'1') = 1"> <!--if count 1 dot elements > 1 and the last digit of the current element is 1 then dont put tr tag--> </xsl:when> <xsl:otherwise> <!--<tr align="left" valign="Top">--><tr><!--HEREHERE--> </xsl:otherwise> </xsl:choose> <td rowspan="{$rowspan}" bgcolor="#FFFFC2" valign="Middle"> <xsl:choose> <xsl:when test="entrydata/text=''"> <B>-Uncategorised Responsibility-<xsl:value-of select="@pos" /></B> </xsl:when> <xsl:otherwise> <B><xsl:value-of select="entrydata/text" /><xsl:value-of select="@pos" /></B> </xsl:otherwise> </xsl:choose> </td> </xsl:when> <!--MISCELLANEOUS, 2 dots--> <xsl:when test="entrydata/@colno='2'"> <xsl:choose> <xsl:when test="((count(../ve/@pos[string-length(translate(.,$Digits,'')) = 2])) > 1) and substring(current()/@pos, string-length(current()/@pos),'1') = 1"> <!--if count 2 dot elements > 1 and the last digit of the current element is 1 then dont put tr tag--> </xsl:when> <xsl:otherwise> <!--<tr align="Left" valign="Top">--><tr><!--HEREHERE--> </xsl:otherwise> </xsl:choose> <td rowspan="{$rowspan}" bgcolor="#FFFFC2" valign="Middle"> <xsl:choose> <xsl:when test="entrydata/text=''"> <B>-Uncategorised Misc-<xsl:value-of select="@pos" /></B> </xsl:when> <xsl:otherwise> <B><xsl:value-of select="entrydata/text" /><xsl:value-of select="@pos" /></B> </xsl:otherwise> </xsl:choose> </td> </xsl:when> <!--PROC, 3 dots--> <xsl:otherwise> <xsl:choose> <xsl:when test="((count(../ve/@pos[string-length(translate(.,$Digits,'')) = 3])) > 1) and substring(current()/@pos, string-length(current()/@pos),'1') = 1"> <!--if count 3 dot elements > 1 and the last digit of the current element is 1 then dont put tr tag--> </xsl:when> <xsl:otherwise> <!--<tr align="Left" valign="Top">--><tr><!--HEREHERE--> </xsl:otherwise> </xsl:choose> <!--proc name--> <td BgColor="#FFFFC2"><xsl:value-of select="entrydata/text" /><xsl:value-of select="@pos" /></td> <!--proc owner--> <td BgColor="#FFFFC2"><xsl:value-of select="entrydata/text" /><xsl:value-of select="@pos" /></td> <!--proc status--> <xsl:choose> <xsl:when test="entrydata[5]/text='Draft'"> <td BGColor="FF0000"><xsl:value-of select="entrydata/text" /><xsl:value-of select="@pos" /></td> </xsl:when> <xsl:otherwise> <td BGColor="00FF00"><xsl:value-of select="entrydata/text" /><xsl:value-of select="@pos" /></td> </xsl:otherwise> </xsl:choose> <!--proc ID number--> <td BgColor="#FFFFC2"><xsl:value-of select="entrydata/text" /><xsl:value-of select="@pos" /></td> <!--</tr>--></tr><!--HEREHERE--> </xsl:otherwise> </xsl:choose> <!--loop through the viewentries by position--> <xsl:apply-templates select="../ve[starts-with(@pos, current()/@pos) and string-length(translate(@pos, $Digits, '' ) ) = 1 + string-length(translate(current()/@pos, $Digits, '' ) ) ]"> </xsl:apply-templates> </xsl:template> </xsl:stylesheet> From: "Thomas V. Nielsen" <verakso@xxxxxxxx> Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx To: <xsl-list@xxxxxxxxxxxxxxxxxxxxxx> Subject: SV: xsl doesnt produce valid xhtml Date: Tue, 21 Oct 2003 08:51:52 +0200 _________________________________________________________________ It's fast, it's easy and it's free. Get MSN Messenger today! http://www.msn.co.uk/messenger XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|