-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
remove_blank_text and other options of XMLParser missing #102
Comments
You have to construct a >>> import lxml.etree
>>> import defusedxml.lxml
>>>
>>> parser = lxml.etree.Parser(remove_blank_text=True, resolve_entities=False)
>>> lookup = lxml.etree.ElementDefaultClassLookup(defusedxml.lxml.RestrictedElement)
>>> parser.set_element_class_lookup(lookup)
>>> e = defusedxml.lxml.XML("<root><el/> </root>", parser=parser)
>>> lxml.etree.tostring(e)
b'<root><el/></root>' |
Hi @tiran, you said in #33 that
So I shouldn't be using the solution you provide, or have you changed your mind? Because I already have the deprecation warning when following your recommendation and it doesn't seem that |
@tiran any update on the deprecated solution? |
The library doesn't provide a way to remove blank text.
Using the basic lxml library:
This is the same for any option mentionned in #23.
These are important features that should be supported .
I tried to use ``XMLParser
from the original libary with the
XML()` of this one, I also tried to use `DefusedXMLParser`.This simply doesn't seem possible.
Can you provide an example on how to access these features?
Thank you.
The text was updated successfully, but these errors were encountered: