importing it will create the tag handler and add it to any
 wxHtmlWinParsers created from that time forth.
 
-Tags of the following form are recognised:
+Tags of the following form are recognised::
 
     <WXP class="classname" [module="modulename"] [width="num"] [height="num"]>
         <PARAM name="parameterName" value="parameterValue>
 strings into a python dictionary and passed to the __init__ method of
 the class as keyword arguments.  This means that they are all
 accessible from the __init__ method as regular parameters, or you use
-the special Python **kw syntax in your __init__ method to get the
+the special Python \*\*kw syntax in your __init__ method to get the
 dictionary directly.
 
 Some parameter values are special and if they are present then they will
                  object and if it fails then the original string value
                  will be used instead.
 
-An example:
+An example::
 
     <wxp module="wx" class="Button">
         <param name="label" value="Click here">
         self.ParseInner(tag)
 
         # create the object
-        parent = self.GetParser().GetWindow()
+        parent = self.GetParser().GetWindowInterface().GetHTMLWindow()
         if parent:
             obj = apply(self.ctx.classObj,
                         (parent,),
             obj.Show(True)
 
             # add it to the HtmlWindow
-            self.GetParser().GetContainer().InsertCell(wx.html.HtmlWidgetCell(obj, self.ctx.floatWidth))
+            self.GetParser().GetContainer().InsertCell(
+                wx.html.HtmlWidgetCell(obj, self.ctx.floatWidth))
             self.ctx = None
 
         return True
 
 
         # check for something that should be evaluated
-        elif value[0] in '[{(' or value[:2] == 'wx':
+        elif value and value[0] in '[{(' or value[:2] == 'wx':
             saveVal = value
             try:
                 value = eval(value, self.ctx.classMod.__dict__)
                 value = saveVal
 
         # convert to wx.Colour
-        elif value[0] == '#':
+        elif value and value[0] == '#':
             try:
                 red   = int('0x'+value[1:3], 16)
                 green = int('0x'+value[3:5], 16)
             except:
                 pass
 
-        self.ctx.kwargs[str(name)] = value
+        if self.ctx:
+          self.ctx.kwargs[str(name)] = value
         return False