add an xml parser

This commit is contained in:
Bezleputh 2014-02-24 20:07:49 +01:00
commit 5ea0307b6a
2 changed files with 43 additions and 7 deletions

View file

@ -38,6 +38,11 @@ def load_lxmlsoup():
return LxmlSoupParser
def load_xml():
from .lxmlparser import LxmlXmlParser
return LxmlXmlParser
def load_html5lib():
from .html5libparser import Html5libParser
return Html5libParser
@ -82,6 +87,7 @@ def get_parser(preference_order=('lxml', 'lxmlsoup')):
"""
if not isinstance(preference_order, (tuple, list)):
preference_order = [preference_order]
for kind in preference_order:
if not 'load_%s' % kind in globals():
continue