I found that "<br/>" is critical to the testbrowser.browser's content parsing:


Block A: (with a "<br/>" in 1st line and 2 options of <select>: throws ParseError: OPTION outside of SELECT)
------------------------------------------------------------------------------------------------------------------------------------------------------------
<input id="ldap.miCosdn" name="ldap.miCosdn" size="40" value="uid=MailUser,dc=totalbb,dc=net.dc=tw"/><br/>
<select name="ldap.miCosdn_options">
  <option
value="uid=MailUser,dc=totalbb,dc=net.dc=tw">uid=MailUser,dc=totalbb,dc=net.dc=tw</option>    <option value="uid=powerMailUser,dc=totalbb,dc=net.dc=tw">uid=powerMailUser,dc=totalbb,dc=net.dc=tw</option> 
</select>------------------------------------------------------------------------------------------------------------------------------------------------------------Block B: (with only one "option", does not raise ParseError) 
<input id="ldap.miCosdn" name="ldap.miCosdn" size="40"value="uid=MailUser,dc=totalbb,dc=net.dc=tw"/><br/><select name="ldap.miCosdn_options">   
<optionvalue="uid=MailUser,dc=totalbb,dc=net.dc=tw">uid=MailUser,dc=totalbb,dc=net.dc=tw</option> 
</select>------------------------------------------------------------------------------------------------------------------------------------------------------------Block C:(remove the "<br/>", even 2 options does not raise 
ParseError)-----------------------------------------------------------------------------------
------------------------------------------------------------------------- <input id="ldap.miCosdn" name="ldap.miCosdn" 
size="40"value="uid=MailUser,dc=totalbb,dc=net.dc=tw"/><select name="ldap.miCosdn_options">   
<optionvalue="uid=MailUser,dc=totalbb,dc=net.dc=tw">uid=MailUser,dc=totalbb,dc=net.dc=tw</option>    
<optionvalue="uid=powerMailUser,dc=totalbb,dc=net.dc=tw">uid=powerMailUser,dc=totalbb,dc=net.dc=tw</option> 
</select>------------------------------------------------------------------------------------------------------------------------------------------------------------ the 
traceback:------------------------------------------------------------------------------------------------------------------------------------------------------------Traceback (most recent call last):  File 
"/mnt/data/workspace/ooldapsoap/ooldapproxysoap.py", line 17, in__call__    result = self.func(*args,**kw)  File "/mnt/data/workspace/ooldapsoap/ooldapproxysoap.py", line 78, in_soap_addEntr
y    code,message = self.browser.addEntry(folderpath,objectClass,**attrs)  File "/mnt/data/workspace/ooldapsoap/browser.py", line 100, in addEntry    
code,message  = self._findSoapResult()  File "/mnt/data/workspace/ooldapsoap/browser.py", line 24, in_findSoapResult    codeControl = 
self.Browser.getControl(name="soap_result_code")  File "/usr/local/Zope-3.4.0c1/lib/python/zope/testbrowser/browser.py",line 335, in getControl  
  intermediate, msg = self._get_all_controls(  File "/usr/local/Zope-3.4.0c1/lib/python/mechanize/_mechanize.py", line309, in forms    return 
self._factory.forms()  File "/usr/local/Zope-3.4.0c1/lib/python/mechanize/_html.py", line 560, informs    self._forms_genf = CachingGeneratorFunction(  
File "/usr/local/Zope-3.4.0c1/lib/python/mechanize/_html.py", line 276, informs    encoding=encoding,  File 
"/usr/local/Zope-3.4.0c1/lib/python/ClientForm/ClientForm.py", line929, in ParseResponse    encoding,  File 
"/usr/local/Zope-3.4.0c1/lib/python/ClientForm/Cli
entForm.py", line959, in ParseFile    fp.feed(data)  File "/usr/local/lib/python2.4/sgmllib.py", line 95, in feed    self.goahead(0)  File 
"/usr/local/lib/python2.4/sgmllib.py", line 129, in goahead    k = self.parse_starttag(i)  File "/usr/local/lib/python2.4/sgmllib.py", line 283, 
in parse_starttag    self.finish_starttag(tag, attrs)  File "/usr/local/lib/python2.4/sgmllib.py", line 317, in finish_starttag    
self.handle_starttag(tag, method, attrs)  File "/usr/local/lib/python2.4/sgmllib.py", line 357, in handle_starttag    method(attrs)  File 
"/usr/local/Zope-3.4.0c1/lib/python/ClientForm/ClientForm.py", line811, in do_option    _AbstractFormParser._start_option(self, attrs)  File 
"/usr/local/Zope-3.4.0c1/lib/python/ClientForm/ClientForm.py", line547, in _start_option    raise ParseError("OPTION outside of 
SELECT")ParseError: OPTION outside of SELECT
_______________________________________________
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users

Reply via email to