Skip to content
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

Add option to pass huge_tree to XMLParser when using lxml #46

Closed
wants to merge 1 commit into from

Conversation

cwieken
Copy link

@cwieken cwieken commented Oct 26, 2020

Define custom XMLParser() with huge_tree parameter when reading from file.
This allows handling of large junit result files when using lxml.

…large files

Define custom XMLParser with huge_tree optional parameter.
This allows handling of large junit result files when using lxml.
Only works with lxml.
@weiwei
Copy link
Owner

weiwei commented Oct 28, 2020

Just curious: how big are the xml files we're dealing with here?

I would like to merge this. If you could provide some benchmark data for normal and large files, that could be very nice.

Thanks!

@weiwei
Copy link
Owner

weiwei commented Oct 28, 2020

#49 dresses the requirement in a more flexible way. Example:

from lxml.etree import XMLParser, parse
from junitparser import JUnitXml

def parse_func(file_path):
    xml_parser = XMLParser(huge_tree=True)
    return parse(file_path, xml_parser)

xml = JUnitXml.fromfile('/path/to/junit.xml', parse_func)
# process xml...

Closing this now.

@weiwei weiwei closed this Oct 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants