[xml] Auto-close in HTML parser.

Date view Thread view Subject view Author view

From: Marc Sanfacon (sanm@copernic.com)
Date: Mon Oct 23 2000 - 10:57:54 EDT


Hi there,
        I have the following HTML file:

<head>
<title>MyBug</title>
</head>

<body>

<FORM name=frmForm1 ACTION="SearchResults.asp" METHOD=POST>
<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0 ID=frmTable>
    <TR VALIGN=TOP>
        <td></td>
        <TD class="BodyText" colspan=2 style="PADDING-RIGHT:0">
            Operating System
        </TD>
        <TD>
            <SELECT NAME=frmOS class="BodyText" style="width:250px;"><OPTION
VALUE="98" Selected>Windows 98 &nbsp; <OPTION VALUE="95" >Windows 95 &nbsp;
<OPTION VALUE="NT" >Windows NT &nbsp;
            </SELECT>
        </TD>
    </TR>
</table>
</BODY>
</HTML>

when ran through libxml, the nodes look like this:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head><title>MyBug</title></head>
<body><form name="frmForm1" action="SearchResults.asp" method="POST"><table
border="0" cellspacing="0" cellpadding="0" id="frmTable"><tr valign="TOP">
<td>
<td class="BodyText" colspan="2" style="PADDING-RIGHT:0">
Operating System </td>
<td><select name="frmOS" class="BodyText" style="width:250px;"><option
value="98" selected>Windows 98 &nbsp; <option value="95">Windows 95 &nbsp;
<option value="NT">Windows NT &nbsp; </option>
</option>
</option></select></td>
</tr></table></form></body>
</html>

As you can see, the /option is given only when the /select is found. I
would have like to get the /option when the other <option> was found.

I fixed the problem by adding:

---------------------------------------------------------------------
 "Better the pride that resides, in a citizen of the world.
  Than the pride that divides, when a colorful rag is
  unfurled." Neil Peart
---------------------------------------------------------------------
Marc Sanfacon, Software developer Copernic.com
e-mail: sanm@copernic.com R&D Group
Tel : (418) 527-0528 ext 1212


----
Message from the list xml@rpmfind.net
Archived at : http://xmlsoft.org/messages/
to unsubscribe: echo "unsubscribe xml" | mail  majordomo@rpmfind.net


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Mon Oct 23 2000 - 11:43:44 EDT