Link to home
Start Free TrialLog in
Avatar of william007
william007

asked on

XML Parsing Error: mismatched tag

I am new to XSLT.
For the XSL code below, my intention is to show different color of table background base on the result of test, but it shows me
"XML Parsing Error: mismatched tag. Expected: </table>."
when I open the xml file in browser.
, seems like I must include </table> before </xsl:when>.

What is the correct way to achieve this purpose in order not to have this problem?
....
 <xsl:choose>
<xsl:when test="./first">
	<table border="0" cellspacing="0" cellpadding="2" width="100%" style="background: red; color: #FFFFFF; ">
</xsl:when>
<xsl:when test="./second">
	<table border="0" cellspacing="0" cellpadding="2" width="100%" style="background: blue; color: #FFFFFF; ">
</xsl:when>
<xsl:otherwise>
	<table border="0" cellspacing="0" cellpadding="2" width="100%" style="background: brown; color: #FFFFFF; ">
</xsl:otherwise>			
</xsl:choose>							
<tr><td>hello</td></tr>
</table>
 
...

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Gertone (Geert Bormans)
Gertone (Geert Bormans)
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of william007
william007

ASKER

Thanks:)