def parse(self, elt, ps):
skip = self.processContents == '<STR_LIT>'<EOL>nspname,pname = _get_element_nsuri_name(elt)<EOL>what = GED(nspname, pname)<EOL>if not skip and what is not None:<EOL><INDENT>pyobj = what.parse(elt, ps)<EOL>try:<EOL><INDENT>pyobj.typecode = what<EOL><DEDENT>except AttributeError as ex:<EOL><INDENT>pyobj = WrapImmutable(pyobj, what)<EOL><DEDENT>return pyobj<EOL><DEDENT>prefix, typeName = SplitQName(_find_type(elt))<EOL>if not skip and typeName:<EOL><INDENT>namespaceURI = _resolve_prefix(elt, prefix or '<STR_LIT>')<EOL>pyclass = GTD(namespaceURI, typeName) or Any<EOL>what = pyclass(pname=(nspname,pname))<EOL>pyobj = what.parse(elt, ps)<EOL>try:<EOL><INDENT>pyobj.typecode = what<EOL><DEDENT>except AttributeError as ex:<EOL><INDENT>pyobj = WrapImmutable(pyobj, what)<EOL><DEDENT>what.typed = True<EOL>return pyobj<EOL><DEDENT>if skip:<EOL><INDENT>what = XML(pname=(nspname,pname), wrapped=False)<EOL><DEDENT>elif self.processContents == '<STR_LIT>':<EOL><INDENT>what = Any(pname=(nspname,pname), unique=True)<EOL><DEDENT>else:<EOL><INDENT>what = Any(pname=(nspname,pname), unique=True)<EOL><DEDENT>try:<EOL><INDENT>pyobj = what.parse(elt, ps)<EOL><DEDENT>except EvaluateException as ex:<EOL><INDENT>self.logger.debug("<STR_LIT>" %str(ex))<EOL>if len(_children(elt)) != <NUM_LIT:0>:<EOL><INDENT>self.logger.debug('<STR_LIT>')<EOL>return Any(aslist=False).parse_into_dict_or_list(elt, ps)<EOL><DEDENT>self.logger.debug("<STR_LIT>", <EOL>what.nspname, what.pname)<EOL>what = String(pname=(nspname,pname), typed=False)<EOL>return WrapImmutable(what.parse(elt, ps), what)<EOL><DEDENT>if pyobj is None: <EOL><INDENT>return<EOL><DEDENT>if type(pyobj) is dict:<EOL><INDENT>return pyobj<EOL><DEDENT>try:<EOL><INDENT>pyobj.typecode = what<EOL><DEDENT>except AttributeError:<EOL><INDENT>pyobj = WrapImmutable(pyobj, what)<EOL><DEDENT>return pyobj<EOL>
processContents -- 'lax' | 'skip' | 'strict', 'strict'
1) if 'skip' check namespaces, and return the DOM node.
2) if 'lax' look for declaration, or definition.  If
   not found return DOM node.
3) if 'strict' get declaration, or raise.